PDA

Click to See Complete Forum and Search --> : SQL summation


Alfred
Jul 26th, 1999, 04:02 PM
Is it possible to create cumulative values in an access table using a query. The problem is:
Period Value CumulativeValue
1 100 100
2 50 150
3 100 350
and so on.
Any ideas appreciated

mcleran
Jul 26th, 1999, 05:31 PM
Yes you can return the cumulative value with an SQL query. It's something like this:

sSQL = SELECT Period, Value, SUM([Value]) As CumulativeValue, FROM Tablename

This will return your 2 columns and a third named 'CumulativeValue', which will be the sum of all of the 'Value' entries.