Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Create a running total

Status
Not open for further replies.

Mack2

Instructor
Mar 12, 2003
336
US
I need to create a field to calculate a running total like below. The field will add the running total to the amount field. Does anyone know how to do this? THANKS!!

ID Amount Running total field
1 12.00 0
2 25.00 27.00
3 62.00 89.00

 
Something like this (SQL code) ?
SELECT A.ID, A.Amount, Nz(Sum(B.Amount),0) AS RunningTotal
FROM yourTable AS A LEFT JOIN yourTable AS B ON A.ID > B.ID
GROUP BY A.ID, A.Amount
ORDER BY 1;


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I ended up using the running sum property. But thanks for helping.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top