assigning a rank based on total sales
Posted
by
Nathaniel_613
on Stack Overflow
See other posts from Stack Overflow
or by Nathaniel_613
Published on 2012-10-07T02:11:02Z
Indexed on
2012/10/07
3:38 UTC
Read the original article
Hit count: 132
ms-access
|ms-access-2007
I need to create a field called “rank”, that ranks each part ID based on total sales, by assigning a sequential number based on total sales, where the higher the total sales, then the lower the rank value. For example, the part ID with the most sales would have a rank value of “1” and the part ID with the next highest sales would have a rank value of “2” and the part ID with the lowest sales would rank with the highest number.
If 2 different parts ID’s have the same total sales, then it is OK if they share the same rank. Please provide me the SQL to copy and paste
Thank you very much in advance, Nathaniel
SELECT qry_rank_01.[total sales amount], qry_rank_01.PART_ID
FROM qry_rank_01;
© Stack Overflow or respective owner