How to Rank

  • Thread starter Thread starter ZIMMJE
  • Start date Start date
Z

ZIMMJE

Is it possible to rank the following data set and return different rank
values when the cost is the same. Any suggestions would be helpful I can't
fiqure this out in access!:

Item cost Vol Rank
1 10 3 1
2 5 2 2
3 5 1 3
 
ZIMMJE said:
Is it possible to rank the following data set and return different rank
values when the cost is the same. Any suggestions would be helpful I can't
fiqure this out in access!:

Item cost Vol Rank
1 10 3 1
2 5 2 2
3 5 1 3


You need to use multiple criteria in the ranking subquery:

(X.Cost > tbl.Cost)
OR (X.Cost >= tbl.Cost And X.Vol >= tbl.Vol)
 
Could you be more specific? I just can't fiqure out how to get started on
this part of the coding.
 
SELECT T.item, T.cost, T.Vol,
(SELECT Count(*) FROM table As X
WHERE (X.Cost > tbl.Cost)
OR (X.Cost >= tbl.Cost And X.Vol >= tbl.Vol)
) As Rank
FROM table As T
 
Back
Top