468,505 Members | 1,728 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

Adding a running sum in SQL

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, 29 views)
Oct 15 '18 #1
0 1687

Post your reply

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

Similar topics

2 posts views Thread by avivgur | last post: by
9 posts views Thread by mareal | last post: by
4 posts views Thread by Dinsdale | last post: by
3 posts views Thread by Jerry Spence1 | last post: by
1 post views Thread by John | last post: by
7 posts views Thread by =?Utf-8?B?U2hpdmEgUmFtYW5p?= | last post: by
reply views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.