return latest date

G

Guest

I have a table with patient chart#'s [Chart] and date of visits [Date].

I want to make a query that returns the [chart] but only the most recent
visit [date].

So basically I would get a list of patients and the last date they were seen.

What would be the best way to do this?
 
J

John Welch

Stefan-
The article Allen recommended is great if you need to get other info along
with just chart number and date, for example which doctor saw the patient on
that date. But if you just need a list of chart nums and last date seen, you
can use the query:

SELECT Chart, Max(VisitDate) AS [Last Seen On] FROM tblVisits GROUP BY
Chart;

This is the equivalent of 'Q1' in step 1 of the article.

By the way, you should avoid having fields named "Date" or anything else
that might get confused with special words used by Access.

hope this helps
-John
 

Ask a Question

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.

Ask a Question

Top