Sum Months with Previous Year Totals

G

Guest

I have a table that has data from July 2005 though the end of 2006. I
created a report that sums the totals by month. I tried to create a YTD
Total in the footer that would only give the total for 2006 of the months
that 2005 had shipments in. So only would total July 2006 - December 2006.
I entered the formula =Sum(IIf([2005]>0,[2006],0)), but this doesn't work
because if an item didn't have a sale in the month of 2005, it doesn't
include that item that 2006 month. I have the monthly sales data in the
monthly footer. Is there a way to tell it to say if the 2005 monthly total
is >0 then to sum all 2006 for that month? Everything I've tried give me the
entire total for a months in 2006.
 
A

Al Campagna

Supe,
Try adding these calculated fields in your report query...
YearGrouping : Year(YourDate) ...and... YearMonthGrouping : Year(YourDate) &
Month(YourDate)
Now the report can be grouped on
YearGrouping Header
YearMonthGrouping Header
Detail............
YearMonthGrouping Footer (w/totals)
YearGrouping Footer (w/totals)

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top