Help with report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a printer program that stores the number of pages that each printer generates. I take monthly counts for each printer. Below is the data for one printer. It has the printer ID, Page Date, and Page Count. I need a way to get the pages printed for each month. So I need to subtract month 6 from 5; month 7 from 6; month 8 from 7; and so on. Is there a way I can do this?

Thanks

pg_pPrinterID pgDate pgCount
31735552 5/12/2003 44929
31735552 6/2/2003 77894
31735552 7/2/2003 100690
31735552 8/4/2003 124269
31735552 9/4/2003 146372
31735552 11/3/2003 182445
31735552 12/1/2003 193818
 
You may need to use a subquery:
SELECT pg_pPrinterID, pgDate, pgCount, (SELECT pgCount FROM tblPageCount p
WHERE DateDiff("M",p.pgDate, tblPageCount.pDate)=1) as PrevpgCount
FROM tblPageCount;

--
Duane Hookom
MS Access MVP


brian said:
I have a printer program that stores the number of pages that each printer
generates. I take monthly counts for each printer. Below is the data for
one printer. It has the printer ID, Page Date, and Page Count. I need a
way to get the pages printed for each month. So I need to subtract month 6
from 5; month 7 from 6; month 8 from 7; and so on. Is there a way I can do
this?
 
Back
Top