By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,575 Members | 3,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,575 IT Pros & Developers. It's quick & easy.

Logic for Ranking

P: 1
Iam having difficulty in writing the logic for Ranking.

I have 3 fields namely City, Service and Score.
There can be multiple records with the same value
For EG :

Calcutta TL 50
Calcutta TL 50
Pune TL 50
Pune LTL 70
HYD LTL 60
Delhi TL 30,

It should rank it as per the specific Service first and then by Score

So the final output looks like

Calcutta TL 50 Rank1
Calcutta TL 50 Rank1
Pune TL 50 Rank1
Pune LTL 70 Rank1
HYD LTL 60 Rank2
Delhi TL 30 Rank2,
Jul 24 '08 #1
Share this Question
Share on Google+
1 Reply


100+
P: 167
Hi alok,

You said that you have three fields, so it shouldn't be that hard.
Try to make query based on your table.
In that query put fields in order you want them to be sorted, and for every field put a sort Ascending/Descending.

The query will be sorted first on column1, then on column2...

Of course you can then put the fields on forms or reports in any order you want and still they will be sorted just like in query.

So make a query that has columns:
Column1=Service
Column2=Score
Column3=City

h.
Jul 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.