Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

top 5 of each group in table query

Status
Not open for further replies.

NigeB

Technical User
Nov 29, 2000
53
GB
I have a table with teamname, fastesttime and date in, what I need to do is write a query which returns the most recent 5 times for each teamname.

What I then need to do is filter out any of those fastesttimes that were recorded/acheived over 3 months ago.

The later part isn't a problem as I have managed to do that, and when I did this with access I used the Dcount facility to number the entries for each team in date order, then filtered out any greater than 5, then filtered out any over 3 months.

Any ideas? I realise I may have to create a nother table with the first filtered results first.

Regards

Nige.
 
Heh might want to stick this in the access forum. In MySQL you might do:
[tt]SELECT (teamname,fastesttime,date) FROM yourtable ORDER BY date DESC[/tt]
then you just take the first five rows returned by your query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top