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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total from past months query

Status
Not open for further replies.

tquest

MIS
Dec 17, 2002
7
US
I have a database that runs monthly queries based on a beginning and end date from the user. After the queries are run based on these dates, 4 different totals ( I need each one separately grouped) are then appended to new table from the queries and a final monthly total is calculated within the appended table. The monthly total then needs to be added to a yearly running total (last months year_to_date amount). I created a new table with the year to date totals for past months, but how can I take a new monthly total (from table1) and add it to last months Year To Date amount (from table2) ? And then how would I place that amount into table2, so it is then added/ready for a new month?

MonthlyTotal=Fixed+Variable+Qualifed+NonQualifed
YTD= MonthlyTotal + lastMonthsYTD

This is my YTD table so far:
Month Year YTD_monthly
1 2002 $7,942,455.71
2 2002 $17,465,124.76
3 2002 $29,582,069.71
4 2002 $43,974,959.08
5 2002 $56,666,763.65
6 2002 $70,625,152.20
7 2002 $82,077,402.78
8 2002 $92,060,649.91
9 2002 $102,867,405.88
10 2002 $111,178,881.45
11 2002
12 2002
1 2003
2 2003

 
Have you tried a simple append query to add your monthly data to the yearly? That may solve one of your problems. Hope it helps.

[neutral]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top