471,059 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,059 software developers and data experts.

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

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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.