Combining Data for a Quarterly Report

  • Thread starter Thread starter Tsidjpt
  • Start date Start date
T

Tsidjpt

I've not been able to work on this for a month and I appreciate the responses
I've received but am still a bit confused. So, I'll try again with some
examples and hopefully a little better explanation. Listed below is the
format and the headings that I need to use.

MONTH USAGE Previous 11 MONTHS USAGE
April 2009 10 132.619 (= to
5/1/2008 to 3/31/2009)
May 2009 12.417 127.504 (= to 6/1/2008 to
4/31/2009)
June 2009 9.872 131.72 (= to 7/1/2008
to 5/31/2009).

Even though this says April through June it could be Jan to March, etc. of
any given year based upon a date range. My query will list the "Usage" totals
by month, but I don't know how to add the previous 11 to each months listed.
Also, if basic is used I'm not sure how to incorporate it. Please feel free
to ask for clarification on any part of this example. I appreciate your time
and patience in answering this.
 
I expect you could use a subquery in your report's record source to get the
previous 11 months. The subquery might look like:

Prev11: (SELECT Sum(USAGE) FROM tblYourtable A WHERE A.[Month] BETWEEN
DateAdd("m",-11,tblYourTable.[MONTH] AND tblYourTable.[Month])
 
Back
Top