473,495 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Logic for Ranking

1 New Member
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
1 1422
hjozinovic
167 New Member
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

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

Similar topics

11
4180
by: Petre Huile | last post by:
I have designed a site for a client, but they have hired an internet marketing person to incrase their search engine ranking and traffic. He wants to put extra-large fonts on every page which will...
5
4033
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each...
1
7842
by: Joseph Bloch | last post by:
In all the threads on ranking in Access queries, I've not seen anything that deals with ranking against a subset of the query results. What I need to do is take the following query results: Dept...
8
1487
by: Kapil Jain | last post by:
Dear All, I have score table in which i am storing scores for online quiz what i want is to allot rank to all candidates as per their scores for that i applied logic that i sorted table order by...
5
10887
by: valglad | last post by:
Hi, The question below was posted about 4 years ago and noone was able to answer it back then. I have virtually the same type of problem so would appreciate if anyone can help. Thanks ...
6
3791
by: sara | last post by:
I hope someone can help with this. Our director wants to have a report that will have the departments (Retail stores) across the top, stores down the side and the RANKING of the YTD dept sales...
5
5066
by: Chris | last post by:
I was wodering if there was a way to rank numbers in a query like this #'s Rank 100 1 99 2 98 3 98 97 5 96 6 96
0
8648
debasisdas
by: debasisdas | last post by:
Rank:-assigns A Unique Number For Each Row Starting With 1,except For Rows That Have Duplicate Values,in Which Case The Same Ranking Is Assigned And A Gap Appears In The Sequence For Each Duplicate...
1
1980
by: Paulo | last post by:
Hi, I need to create a ranking column wich will be the row number... it is the seller wich most sells... Ranking Seller Sum 1 Paul 2.212,00 2 Robert ...
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.