Viewing most recent date per individual record over whole group

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table recording the different dates that patients have visited the office. I want to see the most recent date that each patient has visited. and then use that specific date to calculate their follow up period. I am having trouble pulling the last record per patient over the whole group of records. Is it possible to sort and only see the last value per record?

ie. patient A: 2/2/99; 3/3/00; 4/4/01
patient B: 1/2/02; /3/5/02; 6/6/03

I want to see only: Patient A: 4/4/01
Patient B: 6/6/03
etc.
Do i use Dmax, Dlast, and what criteria/expression do i use.
Thanks so much,
Mel
 
See:
Queries: Getting a related field from a GroupBy (total) query
at:
http://www.mvps.org/access/queries/qry0020.htm

The article suggests 4 approaches.
The subquery will probably be the most efficient.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Mel said:
I have a table recording the different dates that patients have visited
the office. I want to see the most recent date that each patient has
visited. and then use that specific date to calculate their follow up
period. I am having trouble pulling the last record per patient over the
whole group of records. Is it possible to sort and only see the last value
per record?
 
Back
Top