So I'm kind of stumped on how to properly write this query.
I have three tables involved:
tblInspectionSites - 0:M - tblInspections - 0:M tblTreatments
I am trying to write a query to report the details of the latest treatment(s) for each inspection site (if any). "Latest" is determined by a timestamp found in tblInspections.
I am trying to accomplish at least finding a way to get the latest inspection which would make getting the latest treatment details easy.
I am able to get the latest date of inspection using a MAX aggregate on the Timestamp, but how do I get the primary key(s) of those inspections with that latest date?
Thanks in advance,
Adrian