Crocdundee
Board Regular
- Joined
- May 10, 2010
- Messages
- 174
- Office Version
- 2013
- Platform
- Windows
using Access 2007
Hi I would like to filter the max 5 records in a group recordset
Ideally in each groupby i would like to present the top 50% (but that maybe too much to ask for )???
But I would like to filter the top 5 records in the group which is [Trckid]
I can filter all records in the froup and I think i have to use "IN" but not sure where it fits into the SQL.....[NR] is the filter field
Any help here will be appreciated
Regards
Graham
<tbody>
</tbody>
Hi I would like to filter the max 5 records in a group recordset
Ideally in each groupby i would like to present the top 50% (but that maybe too much to ask for )???
But I would like to filter the top 5 records in the group which is [Trckid]
Code:
SELECT Neurals.Trckid, Neurals.Track, Neurals.Rcno, Neurals.Tb, Max(Neurals.NR) AS MaxOfNR
FROM Neurals
GROUP BY Neurals.Trckid, Neurals.RcDate, Neurals.Track, Neurals.Rcno, Neurals.Tb
HAVING (((Neurals.RcDate)=[Forms]![FRMSummary]![cboDateFrom]));
Any help here will be appreciated
Regards
Graham
Trckid | RcDate | Track | Rcno | Tb | Horse | NR |
41504Devo01 | 18/08/2013 | Devonport Synthetic | 1 | 5 | Hoop | 225 |
41504Devo01 | 18/08/2013 | Devonport Synthetic | 1 | 1 | Crambazzled | 177 |
41504Devo01 | 18/08/2013 | Devonport Synthetic | 1 | 2 | Dhanraj | 164 |
41504Devo01 | 18/08/2013 | Devonport Synthetic | 1 | 3 | Hellova Street | 84 |
41504Devo01 | 18/08/2013 | Devonport Synthetic | 1 | 4 | Solo Man | 76 |
41504Devo02 | 18/08/2013 | Devonport Synthetic | 2 | 11 | Kenbiki | 199 |
41504Devo02 | 18/08/2013 | Devonport Synthetic | 2 | 10 | Beryl Bee | 168 |
41504Devo02 | 18/08/2013 | Devonport Synthetic | 2 | 3 | Costabitmore | 133 |
41504Devo02 | 18/08/2013 | Devonport Synthetic | 2 | 5 | Funambulism | 122 |
41504Devo02 | 18/08/2013 | Devonport Synthetic | 2 | 8 | Sharma Magic | 106 |
41504Devo02 | 18/08/2013 | Devonport Synthetic | 2 | 2 | Come On Charger | 104 |
<tbody>
</tbody>
Last edited by a moderator: