My database contains inspection data for inspections done on food facilities in the area.
My task is to build a report that will show: FacilityID, InspectorID, Last InspectionDate. The following sql works, but when I add the InspectorID, it no longer shows the last inspection date, but all inspections done for each facility.
[highlight #F57900]SELECT Inspections.FacilityID, Max(Inspections.InspectionDate) AS MaxOfInspectionDate
FROM Inspections
GROUP BY Inspections.FacilityID;[/highlight]
What am I missing?
Thank you to all the help that may come my way from all you great gurus!
My task is to build a report that will show: FacilityID, InspectorID, Last InspectionDate. The following sql works, but when I add the InspectorID, it no longer shows the last inspection date, but all inspections done for each facility.
[highlight #F57900]SELECT Inspections.FacilityID, Max(Inspections.InspectionDate) AS MaxOfInspectionDate
FROM Inspections
GROUP BY Inspections.FacilityID;[/highlight]
What am I missing?
Thank you to all the help that may come my way from all you great gurus!