Numbering

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!
In my query I want to make new field which puts numbering; to put number 1
for the biggest value, 2 for the second biggest and so on. How can I do it?
 
What you want is Ranking of the records. You don't give us any info about
your table structure, so here is a generic query example:

SELECT TableName.*, (SELECT Count(*) FROM
TableName AS T WHERE
T.FieldOfInterest >= TableName.FieldOfInterest)
AS Ranking
ORDER BY TableName.FieldOfInterest DESC;
--

Ken Snell
<MS ACCESS MVP>

Renchix said:
Hi!
In my query I want to make new field which puts numbering; to put number 1
for the biggest value, 2 for the second biggest and so on. How can I do
it?
 
Back
Top