Filter By Date

S

sturner333

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.
 
D

Duane Hookom

"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);
 
Top