View Full Version : Help with ranking in Access


alana2408
03-18-2009, 07:13 AM
Hi there,

I have a table ( in Access 2003 ) with 6 different people who each have many different accounts with a YTD revenue for each account.

I basically want a table showing all 6 people and for each person their accounts ranked in order of highest grossing revenue.

Anyone have any ideas???

Cheers

Banana
03-18-2009, 07:14 AM
If the revenue is already there (or calculated somehow), you can do a ORDER BY upon that column.

alana2408
03-18-2009, 07:19 AM
Sorry being thick here, what do you mean by that?
I can see the field in the table but what do I put in it?

Banana
03-18-2009, 07:20 AM
In Query Builder, you would get the column, then on the Sort row, select "Ascending". It will then perform ORDER By on that column.

Did that help?

alana2408
03-18-2009, 07:22 AM
That just sorts the whole table? I was looking to sort each account per person so that for example John would have his accounts ranked 1-20 and Sophie would have hers ranked 1-20 etc if you know what I mean??? Thanks!

Banana
03-18-2009, 07:25 AM
Aha, I missed that part. You'd select salespeople, revenue, then order by salespeople and revenue. Salespeople has to be on left-hand side so they order first then revenue.

As for numbering 1-n, this isn't doable in SQL so easily- you may want to display that number in a form where you can control the numbering.