P
PSI
I have the following (scaled down ) tables:
tblPatient
======
PatientID - Autonumber PK
fldName - text
tblVisits
=======
ID - Autonumber PK
PatientID - FK
DateofVisit - Date field
I would like to build a Delete query that removes all but the most
recent visit record for each Patient.
I think I need to do some kind of Max(DateOfVisit) AS MostRecentVist
combined with a WHERE (DateOfVisit < MostRecentVisit ) but not sure
how to do it.
Any help setting this up would be appreciated.
Thanks
Frank
tblPatient
======
PatientID - Autonumber PK
fldName - text
tblVisits
=======
ID - Autonumber PK
PatientID - FK
DateofVisit - Date field
I would like to build a Delete query that removes all but the most
recent visit record for each Patient.
I think I need to do some kind of Max(DateOfVisit) AS MostRecentVist
combined with a WHERE (DateOfVisit < MostRecentVisit ) but not sure
how to do it.
Any help setting this up would be appreciated.
Thanks
Frank