Crocdundee
Board Regular
- Joined
- May 10, 2010
- Messages
- 174
- Office Version
- 2013
- Platform
- Windows
Hi, I wish to retrieve the top 2 records for every Track and Race No from a query on a table
Here is the code to query the table
====================================
SELECT Selections.Rcdate, Selections.Track, Selections.Rcno, Selections.Rctime, Selections.Tab, Selections.Horse, Selections.Runners, Selections.Pred
FROM Selections
WHERE (((Selections.Rcdate)=[Forms]![FrmSelections]![Combo0]) AND ((Selections.Runners)>7))
ORDER BY Selections.Track, Selections.Rcno, Selections.Pred DESC;
==============================================================================
Rcdate picks a date filter from a form
Runners asks for only records where more than 7 runners in the race
Pred is the field that we get the top 2 from it is a numerical field where data is from 100 downwards
Hope one can help here
Regards
Graham
Here is the code to query the table
====================================
SELECT Selections.Rcdate, Selections.Track, Selections.Rcno, Selections.Rctime, Selections.Tab, Selections.Horse, Selections.Runners, Selections.Pred
FROM Selections
WHERE (((Selections.Rcdate)=[Forms]![FrmSelections]![Combo0]) AND ((Selections.Runners)>7))
ORDER BY Selections.Track, Selections.Rcno, Selections.Pred DESC;
==============================================================================
Rcdate picks a date filter from a form
Runners asks for only records where more than 7 runners in the race
Pred is the field that we get the top 2 from it is a numerical field where data is from 100 downwards
Hope one can help here
Regards
Graham