Can I find the last record entered in a "group" of records

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

Guest

I have a multi-group of records and would like to find the "last" entered in
each group based on a date.
 
Try something like

SELECT [M1].*
FROM [TableName] AS M1
WHERE M1.[DateFieldName] In (SELECT Top 1 M2.[DateFieldName]
FROM [TableName] as M2
WHERE M2.[group] =M1.[group]
ORDER BY M2.[DateFieldName] Desc)
 

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

Back
Top