Use a correlated subquery. The query would look something like the following
Replace PatientVisits with the name of your table and the field names with the
relevant names of your fields.
SELECT PatientVisits.*
FROM [PatientVisits]
WHERE VisitDate in
(SELECT Top 2 VisitDates
FROM [PatientVisits] as TEMP
WHERE Temp.PatientID = [PatientVisits].PatientID
ORDER BY VisitDates DESC)
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.