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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.