Hi
I have written a query in access to rank my scores, but I would like to rank these scores within a subset of all the scores. Here is my example
Class_ID Dog_Handler_ID Club Score Rank
1 12 Wallingford 32 4
1 13 Andover 95 8
1 14 Wallingford 40 5
2 12 Wallingford 93 7
2 14 Wallingford 21 3
3 12 Wallingford 92 6
3 13 Andover 14 2
3 14 Wallingford 14 2
What I would like is this
Class_ID Dog_Handler_ID Club Score Rank
1 12 Wallingford 32 1
1 13 Andover 95 3
1 14 Wallingford 40 2
2 12 Wallingford 93 2
2 14 Wallingford 21 1
3 12 Wallingford 92 3
3 13 Andover 14 1
3 14 Wallingford 14 1
If I could order by class_ID and then Rank that would be fab too.
My sql so far is
SELECT Res1.Class_ID, Res1.Dog_Handle r_ID, Res1.Club, Res1.Score, (Select Count(*) from Q_Results Where [Score] < [Res1].[Score]+1;) AS Rank
FROM Q_Results AS Res1;
Many thanks
I have written a query in access to rank my scores, but I would like to rank these scores within a subset of all the scores. Here is my example
Class_ID Dog_Handler_ID Club Score Rank
1 12 Wallingford 32 4
1 13 Andover 95 8
1 14 Wallingford 40 5
2 12 Wallingford 93 7
2 14 Wallingford 21 3
3 12 Wallingford 92 6
3 13 Andover 14 2
3 14 Wallingford 14 2
What I would like is this
Class_ID Dog_Handler_ID Club Score Rank
1 12 Wallingford 32 1
1 13 Andover 95 3
1 14 Wallingford 40 2
2 12 Wallingford 93 2
2 14 Wallingford 21 1
3 12 Wallingford 92 3
3 13 Andover 14 1
3 14 Wallingford 14 1
If I could order by class_ID and then Rank that would be fab too.
My sql so far is
SELECT Res1.Class_ID, Res1.Dog_Handle r_ID, Res1.Club, Res1.Score, (Select Count(*) from Q_Results Where [Score] < [Res1].[Score]+1;) AS Rank
FROM Q_Results AS Res1;
Many thanks
Comment