Using DISTINCT and TOP

G

Guest

I have 2 tables. tblProject and tblDiaryNote. tblDiaryNote has 3 relevant
fields - Note, Date, ProjectNo I want to create a query that lists the most
recent note for each project (ie one record per project). I have tred to use
a combination of DISTINCT and TOP but cannot get it to work. The following
is what I am after if I could remove the duplicate project records

SELECT tblDiaryNote.ProjectNo, tblDiaryNote.Note, tblDiaryNote.Date
FROM tblDiaryNote
ORDER BY tblDiaryNote.ProjectNo DESC , tblDiaryNote.Date DESC;

Anyone have a suggestion?
 

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

Similar Threads


Top