running sum in a table or query in access

G

Guest

I am trying to get the cumulative total after each record I enter. I can get
these values using running sum in a report, but I would like to put these
values into a table or query so I can develop them into a chart.
 
J

John Vinson

I am trying to get the cumulative total after each record I enter. I can get
these values using running sum in a report, but I would like to put these
values into a table or query so I can develop them into a chart.

If you have some strictly-ascending value in the table (such as an
incrementing autonumber or a date/time field defaulting to Now()) you
can use either a subquery or (better, if you want the recordset to be
updateable) DSum() to calculate the running sum:

RunningSum: DSum("[fieldname]", "[tablename]", "[seqfield] <= " &
[seqfield])

will sum across all table records with an equal or lower value of the
sequential field.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top