Adding Ranking to a Query

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

Guest

Ihave a client who needs to see the top 50 revenue generators (sp?). Is there a way that i can display the top 50 (which i know how to do0 and have their ranking (i.e. 1,2,3 etc) displayed in an adjacent column?
 
Hi,


SELECT a.PeopleID, LAST(a.Revenue), COUNT(*)
FROM myTable As a INNER JOIN myTable As b
ON a.Revenue <=b.Revenue
GROUP BY a.PeopleID
HAVING COUNT(*) <= 50
ORDER BY COUNT(*)


Hoping it may help,
Vanderghast, Access MVP


Joe From Jersey said:
Ihave a client who needs to see the top 50 revenue generators (sp?). Is
there a way that i can display the top 50 (which i know how to do0 and have
their ranking (i.e. 1,2,3 etc) displayed in an adjacent column?
 
Back
Top