Hello,
with my SQL code i can make a ranking. But if there are two or more with the same time and score the ranking is wrong.
lets say if there are two with the same score and time the code gives them 4 place instead of place 3.
thanks a lot.
with my SQL code i can make a ranking. But if there are two or more with the same time and score the ranking is wrong.
lets say if there are two with the same score and time the code gives them 4 place instead of place 3.
Code:
SELECT a.RallyKlasnaam, a.naamhond, a.Exhibitor, a.Rallydognr, a.Score, a.Time, Round(CDbl(a.[Score]+(1-a.[Time])),5) AS Points, Count(*) AS Rank
FROM Tbl_ResultsRally AS a INNER JOIN Tbl_ResultsRally AS b ON (Round(CDbl(a.[Score]+(1-a.[Time])),5)<=Round(CDbl(b.[Score]+(1-b.[Time])),5)) AND (a.RallyKlasnaam = b.RallyKlasnaam)
GROUP BY a.RallyKlasnaam, a.naamhond, a.Exhibitor, a.Rallydognr, a.Score, a.Time
ORDER BY a.RallyKlasnaam, a.Score;