I would like to add a 'rank' field to a query. I have a simple query that orders the results based on a field called 'score'. I want to add another field than than auto-fills with 1 for the first record, then 2, for the second, etc... so it shows a rank position. I have tried creating a field using the following - rank: [rank]+1 but no luck. Any ideas?
Add a auto-increasing column to access query
Collapse
X
-
Tags: None
-
If you have data like the following
Do you want the resulting rank to beCode:ID Score 11 90 12 89 13 89 14 85
orCode:1 2 3 4
I'm going to assume the first based on what you tried. The other only adds a little bit to the query.Code:1 2 2 4
Code:SELECT ID , Score , DCount("*", "YourTable", "ID <= " & ID) As Rank FROM YourTable ORDER BY ID
Comment