Cummulative Sum (1 Viewer)

aqif

Registered User.
Local time
Today, 18:14
Joined
Jul 9, 2001
Messages
158
Hi


I am trying to work out a query but dont seem to find the suitable logic. Lets look at my exiting output from query

Select Or_Date, Sum(Or_Amount) As Sum_Amount from MyTable group by Or_Date;

Or_Date Sum_Amount
---------------------------
1-1-2001 25
2-1-2001 20
3-1-2001 45

and so on......now I want the cummulative sum in the next colum like accountants do in thier accounts:

Or_Date Sum_Amount Cummulative_Sum
---------------------------------------------
1-1-2001 25 25
2-1-2001 20 45
3-1-2001 45 90

Thanx in advance

Cheers!
Aqif
 
R

Rich

Guest
You can only do running sums effectivly if you have a sequentialy ordered ID field. The most efficient way is to use a form or report to display the result and not a query.
Look up running sum in help for various methods.
HTH
 

Ron Bell

Registered User.
Local time
Today, 18:14
Joined
Jul 25, 2000
Messages
33
or use a module level VBA to do sums via a recordset based on the query?
 

Users who are viewing this thread

Top Bottom