acrocker3434
Registered User.
- Local time
- Today, 05:21
- Joined
- Oct 24, 2007
- Messages
- 13
Hi-
I have two tables "Patients" and "Office Visits". There is a one to many relationship (one patient has many office visits). I am trying to get a list of the most recent office visit for each patient but when I sort the office visits in descending order and use the top values query to retrieve the top 1 - it gives me the top 1 for the entire list. How can I write a query to give me just the most recent visit for each patient?
THANK YOU!
I have two tables "Patients" and "Office Visits". There is a one to many relationship (one patient has many office visits). I am trying to get a list of the most recent office visit for each patient but when I sort the office visits in descending order and use the top values query to retrieve the top 1 - it gives me the top 1 for the entire list. How can I write a query to give me just the most recent visit for each patient?
THANK YOU!