Link to home
Start Free TrialLog in
Avatar of mltigman
mltigman

asked on

Accumulated Column Sums in Access

I have attached an example MS Excel Spreadsheet which shows the following:

Column A - Spend has a list of values.  
Column B - Cumlative Spend

So B2 = A2.
B3 = A2+B3

and so on...

I need to do this in Access, and I do not know much about it.  So I need a detailed explaination, any SQL needed, etc.  Thanks.
CaSETest.xlsx
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

see this link

How to Create a Grouped Running Sum in a Query
http://support.microsoft.com/?kbid=205183

ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mltigman
mltigman

ASKER

Works great.
Glad to help!

Untested, but may work also:

SELECT t1.ID, t1.Spend, Sum(t2.Spend) AS Cumulative
FROM SomeTable t1 INNER JOIN
    SomeTable t2 ON t2.ID <= t1.ID
GROUP BY t1.ID, t1.Spend
ORDER BY t1.ID, t1.Spend

Open in new window