Full Version: Ranking in Query With Duplicates
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
joeyjojo
I have a table that stores exam results: ExamResultID, PNUM, ExamID,Result. The table is related to a PupilData: Pupil Info, TGID

I need a query that will rank the results depending on the examID and the TGID. I used the MS example it is giving a rank but against all the results in the table, not just the results of the query
[Result] is the alias given to the tblExamResults in the query
Ranking: (Select Count(*) from tblExamResults Where [Result] >[Results].[Result])+1
cmv131
Select ExamID, [Pupil Info], Result
from ExamResults A inner join PupilData B on A.PNum = B.TGID
Order by ExamID, Result desc

Will order them by exam, by result from highest to lowest. I dont know if that is exactly what you are looking for though
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.