He guys, this is probably an easy one for you, but I have a report that when I run it, returns a listing of vehicles that both have recently been and still need to be serviced.
The query that I am using to run the report is titled ""qryMaxDates", and has the following SQL:
The report also runs a Macro with the following code:
PROBLEM: What I am trying to do is to return a list of vehicles that are current (vehicles that have been serviced within the last 365 days = Current), and that are NOT current (vehicles that have not been serviced, or have not been serviced within the last 365 days = Not Current).
Any thoughts???
The query that I am using to run the report is titled ""qryMaxDates", and has the following SQL:
Code:
SELECT PM.CustomerID, Vehicles.AlternateID, Max(PM.DatePMd) AS MaxOfDatePMd
FROM Vehicles INNER JOIN PM ON Vehicles.CustomerID = PM.CustomerID
GROUP BY PM.CustomerID, Vehicles.AlternateID
ORDER BY Max(PM.DatePMd);
The report also runs a Macro with the following code:
Code:
Public Function pastdueAll(ByRef dtVal As Date) As String
Select Case DateDiff("d", dtVal, Date)
Case Is <= today
pastdueAll = "Current"
Case Is > 1 / 1 / 2013
pastdueAll = "Due for Service"
End Select
End Function
PROBLEM: What I am trying to do is to return a list of vehicles that are current (vehicles that have been serviced within the last 365 days = Current), and that are NOT current (vehicles that have not been serviced, or have not been serviced within the last 365 days = Not Current).
Any thoughts???