Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rank Records Based on Value

Status
Not open for further replies.

Bonediggler

Technical User
Sep 20, 2007
19
US
Hi There--

I am wondering how you would assign ranks to records based on their values--i.e. the record with the highest value gets 1, the record with the second highest value gets 2, etc.

Ultimately I need a query that will have 5 original fields and 5 calculated fields which contain rankings for the records in the original fields.


Thank you~
 
something like?
Code:
SELECT A.intValue, Count(A.intValue) AS CountOfintValue
FROM tblTable AS A, tblTable AS B
WHERE (([A].[intvalue]>[b].[intvalue] Or [A].[intvalue]=[b].[intvalue]))
GROUP BY A.intValue
ORDER BY A.intValue;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top