Filter By Date

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

Guest

I have a table of notes. Notes are tied to a Project ID so any particular ID
could have several notes. I would like to do a query that would pick only the
latest note for each project number. Any help would be appreciated.
 
"Any help would be appreciated" regarding your table structure...
Maybe:

SELECT *
FROM tblProjectNotes
WHERE NoteID in (SELECT TOP 1 NoteID
FROM tblProjectNotes n
WHERE n.ProjectID = tblProjectNotes.ProjectID
ORDER BY NoteDate DESC, NoteID DESC);
 
Back
Top