Creating a Running Total in a Query Field (1 Viewer)

Status
Not open for further replies.

ajetrumpet

Banned
Local time
Today, 15:19
Joined
Jun 22, 2007
Messages
5,640
This is a hot topic folks! First of all, there are two meanings of the phrase "Running Total"...

1) The total of a field
2) The progressive total of a field through all records in a dataset.


I personally use the term in the context of meaning #2 listed above. I have attached a sample database that has a query in it that performs a progressive running total of a field in a query. This progressive total is displayed as a separate column in the same query. The DSUM() function that creates this field is the same as the one found in method 2 here:

http://support.microsoft.com/kb/290136


However, there is a difference. The attached sample uses a "ghost" column that is created to indicate what the absolute position of the records are. After testing this, I am thinking that this is probably needed in order for the Microsoft method of DSUM() to work properly. The only drawback to what I have done is the slowness of the query. I'm sure this is due to the combination of DSUM() and the "Absolute Position" function in the same query. If anyone has any suggestions on how to improve this, I'm all "fingers"! :)
 

Attachments

  • Running Total.zip
    476.9 KB · Views: 3,885
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom