M
MArk
Hi All
Have a small problem. I wish to do thh following:
I created a ranking by ranking the scores and named it RANKID.
RankId Name Score
1 JOhn 100
2 Mark 95
3 Greg 90
4 Mike 80
and then i'm calculating the difference between the value above it. like this
1 JOhn 0
2 Mark 5
3 Greg 5
4 Mike 10
I currently;
Select max(score) from Tablex as x where rankid=x!rankid+1 and name=x!name
which works fine
however if i have a tied score like this
1 JOhn 100
2 Mark 90
2 Greg 90
4 Mike 85
and i want the answer like below after i calc the differences to be
1 JOhn 0
2 Mark 10
2 Greg 10
4 Mike 5
problem is i cant use the rankid=rankid+1 as it wont match the rankid for
the fourth ranked.
Ok i could create an if statement.....if error +2..... but sometimes the
scores may have heaps of ties.
any help appreciated.mind boggling...
Have a small problem. I wish to do thh following:
I created a ranking by ranking the scores and named it RANKID.
RankId Name Score
1 JOhn 100
2 Mark 95
3 Greg 90
4 Mike 80
and then i'm calculating the difference between the value above it. like this
1 JOhn 0
2 Mark 5
3 Greg 5
4 Mike 10
I currently;
Select max(score) from Tablex as x where rankid=x!rankid+1 and name=x!name
which works fine
however if i have a tied score like this
1 JOhn 100
2 Mark 90
2 Greg 90
4 Mike 85
and i want the answer like below after i calc the differences to be
1 JOhn 0
2 Mark 10
2 Greg 10
4 Mike 5
problem is i cant use the rankid=rankid+1 as it wont match the rankid for
the fourth ranked.
Ok i could create an if statement.....if error +2..... but sometimes the
scores may have heaps of ties.
any help appreciated.mind boggling...