Allen, thanks for the effort -
I tried Method 1 from your link as the following -
SELECT Scores.Date, Scores.[Contact ID], Scores.[Tee ID], Scores.Score
FROM Scores
WHERE (((Scores.Date) In (Select Top 20 [Date] From Scores Where [Contact
ID]=[Contact ID] Order By [Date] Desc)))
ORDER BY Scores.Date DESC;
still obtained same results as before - last 20 scores regardless of Contact
ID - I am sure this is simple but I can't get there.
Date Contact ID Tee ID Score
5/23/2005 2 5 55
5/23/2005 1 5 45
5/22/2005 2 4 50
5/22/2005 1 4 40
5/21/2005 2 4 50
5/21/2005 1 4 40
5/20/2005 1 5 45
5/20/2005 2 5 55
5/19/2005 2 4 50
5/19/2005 1 4 40
5/18/2005 2 4 50
5/18/2005 1 4 40
5/17/2005 1 4 40
5/17/2005 2 4 50
5/16/2005 1 4 40
5/16/2005 2 4 50
5/15/2005 1 4 40
5/15/2005 2 4 50
5/14/2005 1 4 40
5/14/2005 2 4 50
Allen Browne said:
See:
How to Create a "Top N Values Per Group" Query
at:
http://support.microsoft.com/kb/210039/en-us
for a couple of different approaches.
If the target for this query is to create a report, you could also do it by
creating a report that shows the ContactID and CourseID, and use a subreport
to show the top 20 scores. The query for the subreport is then dead simple:
in query design view, just enter 20 into the Properties box beside the Top
Values property.