K
kdg
I have the following that gives me the last odometer reading for the current month. It works fine, but in addition to this, I need the last odometer read from the previous month. Can anyone help me!!!????
SELECT tblMaintenanceRecord.IDUniqueCarRecNo, Month([MaintDate]) AS MaintMonth, Max(tblMaintenanceRecord.OdometerRead) AS OdometerMonthlyMax
FROM tblMaintenanceRecord
WHERE (((tblMaintenanceRecord.MaintDate)>=DateAdd("m",-1,DateSerial(Year(Date()),Month(Date()),1))))
GROUP BY tblMaintenanceRecord.IDUniqueCarRecNo, Month([MaintDate]);
SELECT tblMaintenanceRecord.IDUniqueCarRecNo, Month([MaintDate]) AS MaintMonth, Max(tblMaintenanceRecord.OdometerRead) AS OdometerMonthlyMax
FROM tblMaintenanceRecord
WHERE (((tblMaintenanceRecord.MaintDate)>=DateAdd("m",-1,DateSerial(Year(Date()),Month(Date()),1))))
GROUP BY tblMaintenanceRecord.IDUniqueCarRecNo, Month([MaintDate]);