By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,461 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Adding a running sum in SQL

P: 13
I would like to add a running sum column to each VT count by Welder/Insp and add another column to assign a number in another column to the item numbers in increments of 20. How do I add this to my SQL to achieve this? I am attaching a copy of the datasheet so you have a better understanding of what I am trying to arrive at.
TRANSFORM Count([Weld Log].Activity) AS CountOfActivity
SELECT [Weld Log].[Welder/Insp], [Weld Log].[Spool #], [Weld Log].[Weld #], [Weld Log].WPS, [Weld Log].Type, [Weld Log].Date, [Weld Log].[Pass or Fail], [Weld Log].Comment, Count([Weld Log].Activity) AS [Total Of Activity]
FROM [Weld Log]
WHERE ((([Weld Log].Type)="BUTTWELD") AND ((([Weld Log].[Pass or Fail])="PASS" Or ([Weld Log].[Pass or Fail])="Fail") And (([Weld Log].[Pass or Fail])="Pass" Or ([Weld Log].[Pass or Fail])="Fail")) AND (([Weld Log].NDE)=("VT")))
GROUP BY [Weld Log].[Welder/Insp], [Weld Log].[Spool #], [Weld Log].[Weld #], [Weld Log].WPS, [Weld Log].NDE, [Weld Log].Type, [Weld Log].Date, [Weld Log].[Pass or Fail], [Weld Log].Comment, [Weld Log].NDE
PIVOT [Weld Log].NDE;
Attached Images
File Type: jpg 20181015101751424.jpg.jpg (39.5 KB, 12 views)
Oct 15 '18 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.