I have an access database that contains data from our fuel tanks at our 4 plants.
Table name = exporttrans
field names:
siteid = sites 1 to 4
vehicleid = id number for trucks
trantime = transaction date/time formmated to just mm/yyyy
quantity - quantity of fuel pumped at time of transaction
Heres the current query:
TRANSFORM Sum(ExportTrans.[QUANTITY]) AS SumOfQUANTITY
SELECT ExportTrans.[TRANTIME], ExportTrans.[VEHICLEID], Sum(ExportTrans.[QUANTITY]) AS [Total Of QUANTITY]
FROM ExportTrans
GROUP BY ExportTrans.[TRANTIME], ExportTrans.[VEHICLEID]
PIVOT ExportTrans.[SITEID];
THis provides a table that goes:
Date Truck ID Quantitytotal site 1 site 2 site 3 site 4
CUrrently, the typical output looks like this:
11/2008 000045 45.7 45.7
11/2008 00076 55.2 55.2
So you see where this is going. But, trucks fill up multiple times a day and I am looking at getting just monthly stats.
Essentially, I want one line entry per truck per month.
Any thoughts?
*on edit*
The date stamp is actually a date/time stamp that I have formatted out. So the actuall date data is time/date stored as mm/dd/yyyy hh:mm:ss. That might be the cause of my multiple date entries. So, I am assuming that in my query, I need to filter there for the mm/yyyy to get all transaction for one month.
Make sense?