Hi Duane
I am sorry but you have lost me.
I don't understand what ties are :|
Kind Regards
Tanya
:
I think it is still possible to break ties but you have to decide how
ties
are to be broken.
--
Duane Hookom
Microsoft Access MVP
:
Thank you for this clarification of the problem Duane, I wasn't
sure how to
best describe the problem.
From your earlier post, I gather you are saying what I ask is not
possible?
cheers
Tanya
:
louisjohnphillips,
I don't think you have grasped what the query creates for a
record set. The
[Rank] field in the original query will actually number the
records
sequentially based on score. The MIUnionQuery must be referenced
in the query
twice in order to see where a record falls in the ranking.
The OP wants to know how to break the ties where more than one
record has
the same Rank based on the same Score. The original SQL is very
good. It only
needs to identify which record in a tie might be the higher rank.
--
Duane Hookom
Microsoft Access MVP
:
On Jun 15, 9:04 am, Duane Hookom
<duanehookom@NO_SPAMhotmail.com>
wrote:
You can't break ties without specifying some tie breaking
rule.
--
Duane Hookom
Microsoft Access MVP
:
Hi I have finally managed to work out how to rank the
results from a MI Quiz,
however I cannot work out how to avoid having to scores
equal. i.e. 2 in
second place.
Here is my sql
SELECT a1.StudentID, a1.Skill, Count(a2.Score) AS Rank
FROM MIUnionQuery AS a1, MIUnionQuery AS a2
WHERE (((a1.Score)<=a2.Score Or (a1.Score)=a2.Score))
GROUP BY a1.StudentID, a1.Skill, a1.Score
ORDER BY a1.Score DESC;
Any suggests please?
Kind Regards
Tanya- Hide quoted text -
- Show quoted text -
Perhaps a better description of the problem would help here.
This query seems to employ a single table named "MIUnionQuery".
From
the table's name one might assume it is derived from some other
data.
Nonetheless, this query joins the "MIUnionQuery" with itself,
but does
not use the StudentID key. Therefore, it will join pairs of
Scores
without regard to which student earned the score.
Further, the WHERE clause is redundant. A1.Score is to be less
that
or equal to A2.Score.
There is no need to repeat the condition.
To rank Students by their cumulative Scores one might query:
SELECT a1.StudentID, a1.skill, sum( a1.Score )
from MIUnionQuery as a1
group by a1.StudentID, a1.skill
order by 3