Re: Simple / Complicated Query?



On May 30, 2:21 am, z.ghu...@xxxxxxxxx wrote:
Hi,

I am trying to create a query from a table which has an ID, Diary and
Date fields.
A particular ID may have several diary entries which all have their
specific date.

What I'm after is a query that will show me only the previous 3 diary
entries sorted by date.

Any thoughts would be greatly appreciated

Thanks
Zieshan

It goes something like this (change field names to match your table
field names):

SELECT tblDiary.ID, tblDiary.Diary, tblDiary.Date
FROM tblDiary
WHERE tblDiary.Date In (SELECT TOP 3 tblDiary.Date
FROM tblDiary
GROUP BY tblDiary.Date);

Regards,
Branislav Mihaljev
Microsoft Access MVP
.


Quantcast