Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem creating running totals

Status
Not open for further replies.

JosephRoy

Programmer
Mar 4, 2004
8
0
0
US
Hello,

I have a query in which I would like to create a couple of running total fields. This query is based on another query. The results look like this:

Week# Amount Games
1 600 3
2 650 3
3 590 3
4 620 3

What I would like is the following:

Week# Amount Games SumAmt SumGms
1 600 3 600 3
2 650 3 1250 6
3 590 3 1840 9
4 620 3 2460 12

Any help would be greatly appreciated.

Thanks.
 
Assuming you are using the query grid then add Week, Amount, Games. I have called your first query Query1.
Then add :

SumAmt:Dsum("[Amount]", "Query1", "Query1.Week <= " & week)
In the next column:
SumGames:Dsum("[Games]", "Query1", "Query1.Week <= " & week)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top