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

Ranking Problem in Access

P: 2
I have tried to rank records in Access Table with some criteria.
In a School DB the will be on the basis of Marks, but the Criteria is the student should be ranked only their own CLASS and SEC.
I have tried this like....
SELECT School.ID, School.NAME, School.SCHOOL, School.CLASS, School.SEC, School.MARKS, (SELECT Count(*) FROM School_Marks AS [XX] WHERE [XX].SCHOOL = School_Marks.SCHOOL AND [XX].CLASS = School_Marks.CLASS AND [XX].SEC = School_Marks.SEC AND [XX].MARKS > School_Marks.MARKS) AS Rank

Now there is some problem Like......

Happening
Marks Rank
100 1
99 2
99 2
98 4
98 4
97 6
97 6
97 6
96 9

I Want
Marks Rank
100 1
99 2
99 2
98 3
98 3
97 4
97 4
97 4
96 5

If is there any solution please help me......
Thanking you

Regards
Indra Nath Lahiry
Mar 21 '12 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,356
Do the ranking on a distinct version and then join that back to the main table.
Mar 21 '12 #2

Post your reply

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