Running Sum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have database that has a table with about 6 million records that have
been loaded in a set order and have an autonumber to solve any sorting
issuses.

I would like to update a field with a running sum of costs, is this possible?

Many thanks in anticipation

kind rgds

Colin
 
Normally it is considered bad programming to store a value that can be
calculated at any point from other data, but in some instances due to size
of data this can be desirable.

to not store the amount but to have it displayed on a form use an un-bound
textbox and the control source =

=Sum(yourfield)

will produce a running total of all yourfield's totalled together.

if you must store the value do not store it in the same table as you are
calculating from as the management of the values could become very
difficult, you will need a table just for storing totals. I have seen this
where a program does not allow you to update values for 'closed' months so
the calculation does not change for that month then the totals for that
month are stored in a table. Again I would suggest not storing the value
unless you have to.

If I have missing the point of your question provide some more detail and I
will have another go at it.
 
Back
Top