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

ASP position question

P: n/a
Ok gang, I am going to try and explain my question.

I have a page where a person's position is listed. This is what I am using
to get that position.
I first sort by the round field in the DB, then I display the table on the
page. The problem I have is, if there are say 2 people with the same round
number, it continue's counting. For example
http://65.61.20.190/GIG/ladder/main.asp

see how the 4th and 5th place show the same number of laps )that is the
number in the round field in the DB), what I want is to show both of them
with a 4. here is my script:
<%
set admin1 = conn.execute ("SELECT * FROM rounds where round > 0 ORDER
BY round DESC,username ASC")

%>
<div align="center">
<center>
<table border="0" cellpadding="2" style="border-collapse: collapse"
width="27%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3">
<p align="center"><b>GIG Ladder Lap Count</b></td>
</tr>
<tr>
<td width="50%" align="center" nowrap><b><font
size="4">Pos</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Name</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Laps</font></b></td>
</tr>
<%
game = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=game%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
game = game + 1
admin1.movenext
loop
%>
</table>

as you can see game is the position column in the displayed table.
How can I have it show the same pos for a number that is the same, but
continue counting as if they were NOT the same. Meaning, if there was a
person below them, they would be in 6th place, since 2 are tied for 4th?
I hope this makes sense
Please help
Bam

Dec 4 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
One method of doing this would be to add/change a couple of variables:
numLastValue, numRealPos, numDisplayPos

Initialise with numRealPos = 0 and numDisplayPos = 1

Then, inserted near the start of each loop:
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If

You then output numDisplayPos in place of game.

I'd recommend giving your variables meaningful names - e.g. numRound rather
than var1, rsRoundResults rather than admin1, etc - makes life a lot easier
when your pages get more complex. Also, you should avoid SELECT * in
database queries - http://www.aspfaq.com/show.asp?id=2096

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:3-******************************@adelphia.com...
Ok gang, I am going to try and explain my question.

I have a page where a person's position is listed. This is what I am using
to get that position.
I first sort by the round field in the DB, then I display the table on the
page. The problem I have is, if there are say 2 people with the same round
number, it continue's counting. For example
http://65.61.20.190/GIG/ladder/main.asp

see how the 4th and 5th place show the same number of laps )that is the
number in the round field in the DB), what I want is to show both of them
with a 4. here is my script:
<%
set admin1 = conn.execute ("SELECT * FROM rounds where round > 0
ORDER
BY round DESC,username ASC")

%>
<div align="center">
<center>
<table border="0" cellpadding="2" style="border-collapse: collapse"
width="27%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3">
<p align="center"><b>GIG Ladder Lap Count</b></td>
</tr>
<tr>
<td width="50%" align="center" nowrap><b><font
size="4">Pos</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Name</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Laps</font></b></td>
</tr>
<%
game = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=game%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
game = game + 1
admin1.movenext
loop
%>
</table>

as you can see game is the position column in the displayed table.
How can I have it show the same pos for a number that is the same, but
continue counting as if they were NOT the same. Meaning, if there was a
person below them, they would be in 6th place, since 2 are tied for 4th?
I hope this makes sense
Please help
Bam

Dec 5 '05 #2

P: n/a
thanks for the reply. is this what you mean:

<%
numRealPos = 0 and numDisplayPos = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numDisplayPos%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If
admin1.movenext
loop
%>

if so, the output still isn't correct:
http://www.gig-golf.com/GIG/ladder/main3.asp
the first position is 0 and 3 and 4 would be incorrect.
please advise
Bam
ps
i will take your advice in naming things. I do see what you mean, as to how
it can become confusing later.
"Jevon" <pl****@ask.com> wrote in message
news:Oq***************@TK2MSFTNGP09.phx.gbl...
One method of doing this would be to add/change a couple of variables:
numLastValue, numRealPos, numDisplayPos

Initialise with numRealPos = 0 and numDisplayPos = 1

Then, inserted near the start of each loop:
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If

You then output numDisplayPos in place of game.

I'd recommend giving your variables meaningful names - e.g. numRound
rather than var1, rsRoundResults rather than admin1, etc - makes life a
lot easier when your pages get more complex. Also, you should avoid SELECT
* in database queries - http://www.aspfaq.com/show.asp?id=2096

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:3-******************************@adelphia.com...
Ok gang, I am going to try and explain my question.

I have a page where a person's position is listed. This is what I am
using
to get that position.
I first sort by the round field in the DB, then I display the table on
the
page. The problem I have is, if there are say 2 people with the same
round
number, it continue's counting. For example
http://65.61.20.190/GIG/ladder/main.asp

see how the 4th and 5th place show the same number of laps )that is the
number in the round field in the DB), what I want is to show both of them
with a 4. here is my script:
<%
set admin1 = conn.execute ("SELECT * FROM rounds where round > 0
ORDER
BY round DESC,username ASC")

%>
<div align="center">
<center>
<table border="0" cellpadding="2" style="border-collapse:
collapse"
width="27%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3">
<p align="center"><b>GIG Ladder Lap Count</b></td>
</tr>
<tr>
<td width="50%" align="center" nowrap><b><font
size="4">Pos</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Name</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Laps</font></b></td>
</tr>
<%
game = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=game%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
game = game + 1
admin1.movenext
loop
%>
</table>

as you can see game is the position column in the displayed table.
How can I have it show the same pos for a number that is the same, but
continue counting as if they were NOT the same. Meaning, if there was a
person below them, they would be in 6th place, since 2 are tied for 4th?
I hope this makes sense
Please help
Bam


Dec 5 '05 #3

P: n/a
Close:

<%
numRealPos = 0
numDisplayPos = 1
do while not admin1.eof
admin1.movenext
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If
%>
<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numDisplayPos%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
loop
%>

Should give what you want.

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:1e******************************@adelphia.com ...
thanks for the reply. is this what you mean:

<%
numRealPos = 0 and numDisplayPos = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numDisplayPos%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If
admin1.movenext
loop
%>

if so, the output still isn't correct:
http://www.gig-golf.com/GIG/ladder/main3.asp
the first position is 0 and 3 and 4 would be incorrect.
please advise
Bam
ps
i will take your advice in naming things. I do see what you mean, as to
how it can become confusing later.
"Jevon" <pl****@ask.com> wrote in message
news:Oq***************@TK2MSFTNGP09.phx.gbl...
One method of doing this would be to add/change a couple of variables:
numLastValue, numRealPos, numDisplayPos

Initialise with numRealPos = 0 and numDisplayPos = 1

Then, inserted near the start of each loop:
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If

You then output numDisplayPos in place of game.

I'd recommend giving your variables meaningful names - e.g. numRound
rather than var1, rsRoundResults rather than admin1, etc - makes life a
lot easier when your pages get more complex. Also, you should avoid
SELECT * in database queries - http://www.aspfaq.com/show.asp?id=2096

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:3-******************************@adelphia.com...
Ok gang, I am going to try and explain my question.

I have a page where a person's position is listed. This is what I am
using
to get that position.
I first sort by the round field in the DB, then I display the table on
the
page. The problem I have is, if there are say 2 people with the same
round
number, it continue's counting. For example
http://65.61.20.190/GIG/ladder/main.asp

see how the 4th and 5th place show the same number of laps )that is the
number in the round field in the DB), what I want is to show both of
them
with a 4. here is my script:
<%
set admin1 = conn.execute ("SELECT * FROM rounds where round > 0
ORDER
BY round DESC,username ASC")

%>
<div align="center">
<center>
<table border="0" cellpadding="2" style="border-collapse:
collapse"
width="27%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3">
<p align="center"><b>GIG Ladder Lap Count</b></td>
</tr>
<tr>
<td width="50%" align="center" nowrap><b><font
size="4">Pos</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Name</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Laps</font></b></td>
</tr>
<%
game = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=game%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
game = game + 1
admin1.movenext
loop
%>
</table>

as you can see game is the position column in the displayed table.
How can I have it show the same pos for a number that is the same, but
continue counting as if they were NOT the same. Meaning, if there was a
person below them, they would be in 6th place, since 2 are tied for 4th?
I hope this makes sense
Please help
Bam



Dec 5 '05 #4

P: n/a
thanks a bunch. I did have to move the admin1.movenext
down by the loop for it to work. but when I did that, all was fine.
again, thanks a bunch. I learned quite a bit from this.

Bam
"Jevon" <pl****@ask.com> wrote in message
news:%2********************@TK2MSFTNGP12.phx.gbl.. .
Close:

<%
numRealPos = 0
numDisplayPos = 1
do while not admin1.eof
admin1.movenext
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If
%>
<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numDisplayPos%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
loop
%>

Should give what you want.

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:1e******************************@adelphia.com ...
thanks for the reply. is this what you mean:

<%
numRealPos = 0 and numDisplayPos = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numDisplayPos%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If
admin1.movenext
loop
%>

if so, the output still isn't correct:
http://www.gig-golf.com/GIG/ladder/main3.asp
the first position is 0 and 3 and 4 would be incorrect.
please advise
Bam
ps
i will take your advice in naming things. I do see what you mean, as to
how it can become confusing later.
"Jevon" <pl****@ask.com> wrote in message
news:Oq***************@TK2MSFTNGP09.phx.gbl...
One method of doing this would be to add/change a couple of variables:
numLastValue, numRealPos, numDisplayPos

Initialise with numRealPos = 0 and numDisplayPos = 1

Then, inserted near the start of each loop:
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If

You then output numDisplayPos in place of game.

I'd recommend giving your variables meaningful names - e.g. numRound
rather than var1, rsRoundResults rather than admin1, etc - makes life a
lot easier when your pages get more complex. Also, you should avoid
SELECT * in database queries - http://www.aspfaq.com/show.asp?id=2096

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:3-******************************@adelphia.com...
Ok gang, I am going to try and explain my question.

I have a page where a person's position is listed. This is what I am
using
to get that position.
I first sort by the round field in the DB, then I display the table on
the
page. The problem I have is, if there are say 2 people with the same
round
number, it continue's counting. For example
http://65.61.20.190/GIG/ladder/main.asp

see how the 4th and 5th place show the same number of laps )that is the
number in the round field in the DB), what I want is to show both of
them
with a 4. here is my script:
<%
set admin1 = conn.execute ("SELECT * FROM rounds where round > 0
ORDER
BY round DESC,username ASC")

%>
<div align="center">
<center>
<table border="0" cellpadding="2" style="border-collapse:
collapse"
width="27%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3">
<p align="center"><b>GIG Ladder Lap Count</b></td>
</tr>
<tr>
<td width="50%" align="center" nowrap><b><font
size="4">Pos</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Name</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Laps</font></b></td>
</tr>
<%
game = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=game%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
game = game + 1
admin1.movenext
loop
%>
</table>

as you can see game is the position column in the displayed table.
How can I have it show the same pos for a number that is the same, but
continue counting as if they were NOT the same. Meaning, if there was
a
person below them, they would be in 6th place, since 2 are tied for
4th?
I hope this makes sense
Please help
Bam




Dec 5 '05 #5

P: n/a
Whoops, yeah, that should have been left at the end of the loop. Doh!

Glad I could help.

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:KN******************************@adelphia.com ...
thanks a bunch. I did have to move the admin1.movenext
down by the loop for it to work. but when I did that, all was fine.
again, thanks a bunch. I learned quite a bit from this.

Bam
"Jevon" <pl****@ask.com> wrote in message
news:%2********************@TK2MSFTNGP12.phx.gbl.. .
Close:

<%
numRealPos = 0
numDisplayPos = 1
do while not admin1.eof
admin1.movenext
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If
%>
<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numDisplayPos%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
loop
%>

Should give what you want.

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:1e******************************@adelphia.com ...
thanks for the reply. is this what you mean:

<%
numRealPos = 0 and numDisplayPos = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numDisplayPos%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If
admin1.movenext
loop
%>

if so, the output still isn't correct:
http://www.gig-golf.com/GIG/ladder/main3.asp
the first position is 0 and 3 and 4 would be incorrect.
please advise
Bam
ps
i will take your advice in naming things. I do see what you mean, as to
how it can become confusing later.
"Jevon" <pl****@ask.com> wrote in message
news:Oq***************@TK2MSFTNGP09.phx.gbl...
One method of doing this would be to add/change a couple of variables:
numLastValue, numRealPos, numDisplayPos

Initialise with numRealPos = 0 and numDisplayPos = 1

Then, inserted near the start of each loop:
numRealPos = numRealPos + 1
If Not var1 = numLastValue Then
numLastValue = var1
numDisplayPos = numRealPos
End If

You then output numDisplayPos in place of game.

I'd recommend giving your variables meaningful names - e.g. numRound
rather than var1, rsRoundResults rather than admin1, etc - makes life a
lot easier when your pages get more complex. Also, you should avoid
SELECT * in database queries - http://www.aspfaq.com/show.asp?id=2096

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:3-******************************@adelphia.com...
> Ok gang, I am going to try and explain my question.
>
> I have a page where a person's position is listed. This is what I am
> using
> to get that position.
> I first sort by the round field in the DB, then I display the table on
> the
> page. The problem I have is, if there are say 2 people with the same
> round
> number, it continue's counting. For example
> http://65.61.20.190/GIG/ladder/main.asp
>
> see how the 4th and 5th place show the same number of laps )that is
> the
> number in the round field in the DB), what I want is to show both of
> them
> with a 4. here is my script:
>
>
> <%
> set admin1 = conn.execute ("SELECT * FROM rounds where round > 0
> ORDER
> BY round DESC,username ASC")
>
> %>
> <div align="center">
> <center>
> <table border="0" cellpadding="2" style="border-collapse:
> collapse"
> width="27%" id="AutoNumber1">
> <tr>
> <td width="100%" colspan="3">
> <p align="center"><b>GIG Ladder Lap Count</b></td>
> </tr>
> <tr>
> <td width="50%" align="center" nowrap><b><font
> size="4">Pos</font></b></td>
> <td width="50%" align="center" nowrap><b><font
> size="4">Name</font></b></td>
> <td width="50%" align="center" nowrap><b><font
> size="4">Laps</font></b></td>
> </tr>
> <%
> game = 1
> do while not admin1.eof
> var1 = admin1.fields.item("round").value
> var2 = admin1.fields.item("username").value
> %>
>
> <tr>
> <td width="50%" align="center"><b><font size="4"
> color="#C0C0C0"><%=game%></font></b></td>
> <td width="50%" align="center"><b><font size="4"
> color="#C0C0C0"><%=var2%></font></b></td>
> <td width="50%" align="center"><b><font size="4"
> color="#C0C0C0"><%=var1%></font></b></td>
> </tr>
> <%
> game = game + 1
> admin1.movenext
> loop
> %>
> </table>
>
> as you can see game is the position column in the displayed table.
> How can I have it show the same pos for a number that is the same, but
> continue counting as if they were NOT the same. Meaning, if there was
> a
> person below them, they would be in 6th place, since 2 are tied for
> 4th?
> I hope this makes sense
> Please help
> Bam
>
>
>



Dec 5 '05 #6

P: n/a
The solution you gave worked great, but now I have something more to add.
Is there a way to tell the script, that if 2 places do have the same number,
that it would put a T there? Like T4 meaning tied for 4th place?
"Jeff" <gi*****@adelphia.net> wrote in message
news:3-******************************@adelphia.com...
Ok gang, I am going to try and explain my question.

I have a page where a person's position is listed. This is what I am using
to get that position.
I first sort by the round field in the DB, then I display the table on the
page. The problem I have is, if there are say 2 people with the same round
number, it continue's counting. For example
http://65.61.20.190/GIG/ladder/main.asp

see how the 4th and 5th place show the same number of laps )that is the
number in the round field in the DB), what I want is to show both of them
with a 4. here is my script:
<%
set admin1 = conn.execute ("SELECT * FROM rounds where round > 0
ORDER
BY round DESC,username ASC")

%>
<div align="center">
<center>
<table border="0" cellpadding="2" style="border-collapse: collapse"
width="27%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3">
<p align="center"><b>GIG Ladder Lap Count</b></td>
</tr>
<tr>
<td width="50%" align="center" nowrap><b><font
size="4">Pos</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Name</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Laps</font></b></td>
</tr>
<%
game = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=game%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
game = game + 1
admin1.movenext
loop
%>
</table>

as you can see game is the position column in the displayed table.
How can I have it show the same pos for a number that is the same, but
continue counting as if they were NOT the same. Meaning, if there was a
person below them, they would be in 6th place, since 2 are tied for 4th?
I hope this makes sense
Please help
Bam

Dec 5 '05 #7

P: n/a
Yeah it's possible - requires a few more variables though, and adjustment of
the loop.
(Pseudocode)

<%
If Not admin1.EOF Then
numRealPos = 1
numDisplayPos = 1
boolTied = false
numLastRound = admin1.fields.item("round").value
strLastUsername = admin1.fields.item("username").value
admin1.movenext
do while not admin1.eof
numThisRound = admin1.fields.item("round").value
strThisUsername = admin1.fields.item("username").value
If Not numLastRound = numThisRound Then
boolTied = false
Else
boolTied = true
End If
%>
<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%
If boolTied = True Then
Response.Write "T"
End If
Response.Write numDisplayPos
%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=strLastUsername%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numLastRound%></font></b></td>
</tr>
<%
If Not numLastRound = numThisRound Then
numLastRound = numThisRound
numDisplayPos = numRealPos
End If

strLastUserName = strThisUserName
numRealPos = numRealPos + 1

admin1.movenext
loop
%>
<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%
If boolTied = True Then
Response.Write "T"
End If
Response.Write numDisplayPos
%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=strLastUsername%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numLastRound%></font></b></td>
</tr>
<%
End If
%>
I think something like that will do what you want - expect a few syntax
errors and possible logic errors though. It's not particularly tidy, and
there may be better ways to achieve what you want, but it's a start :)

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:Lc******************************@adelphia.com ...
The solution you gave worked great, but now I have something more to add.
Is there a way to tell the script, that if 2 places do have the same
number, that it would put a T there? Like T4 meaning tied for 4th place?
"Jeff" <gi*****@adelphia.net> wrote in message
news:3-******************************@adelphia.com...
Ok gang, I am going to try and explain my question.

I have a page where a person's position is listed. This is what I am
using
to get that position.
I first sort by the round field in the DB, then I display the table on
the
page. The problem I have is, if there are say 2 people with the same
round
number, it continue's counting. For example
http://65.61.20.190/GIG/ladder/main.asp

see how the 4th and 5th place show the same number of laps )that is the
number in the round field in the DB), what I want is to show both of them
with a 4. here is my script:
<%
set admin1 = conn.execute ("SELECT * FROM rounds where round > 0
ORDER
BY round DESC,username ASC")

%>
<div align="center">
<center>
<table border="0" cellpadding="2" style="border-collapse:
collapse"
width="27%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3">
<p align="center"><b>GIG Ladder Lap Count</b></td>
</tr>
<tr>
<td width="50%" align="center" nowrap><b><font
size="4">Pos</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Name</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Laps</font></b></td>
</tr>
<%
game = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=game%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
game = game + 1
admin1.movenext
loop
%>
</table>

as you can see game is the position column in the displayed table.
How can I have it show the same pos for a number that is the same, but
continue counting as if they were NOT the same. Meaning, if there was a
person below them, they would be in 6th place, since 2 are tied for 4th?
I hope this makes sense
Please help
Bam


Dec 7 '05 #8

P: n/a
Hey Jevon. Sorry it took so lang to get back.
It works/isn't working.
let me show you what it is doing.
http://www.gig-golf.com/GIG/ladder/current2.asp

now let me show you the script I have. I had to make changes to what you
gave, in order to fit it right. But anyway:

<%
Set standings_player = Conn.Execute("SELECT * FROM rounds where total_score
5 ORDER BY total_score DESC, username ASC")
If Not standings_player.EOF Then
numRealPos = 1
numDisplayPos = 1
boolTied = false
numLastRound = standings_player.fields.item("total_score").value
strLastUsername = standings_player.fields.item("username").value
standings_player.movenext
do while not standings_player.eof
numThisRound = standings_player.fields.item("total_score").value
strThisUsername = standings_player.fields.item("username").value
If Not numLastRound = numThisRound Then
boolTied = false
Else
boolTied = true
End If
%>


<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%
If boolTied = True Then
Response.Write "T"
End If
Response.Write numDisplayPos
%></font></b>&nbsp;</td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=strLastUsername%></font></b>&nbsp;</td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numLastRound%></font></b>&nbsp;</td>
</tr>
<%
If Not numLastRound = numThisRound Then
numLastRound = numThisRound
numDisplayPos = numRealPos
End If

strLastUserName = strThisUserName
numRealPos = numRealPos + 1

standings_player.movenext
loop
%>
<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%
If boolTied = True Then
Response.Write "T"
End If
Response.Write numDisplayPos
%></font></b>&nbsp;</td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=strLastUsername%></font></b>&nbsp;</td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numLastRound%></font></b>&nbsp;</td>
</tr>
<%
End If
%>
"Jevon" <pl****@ask.com> wrote in message
news:u6****************@TK2MSFTNGP14.phx.gbl... Yeah it's possible - requires a few more variables though, and adjustment
of the loop.
(Pseudocode)

<%
If Not admin1.EOF Then
numRealPos = 1
numDisplayPos = 1
boolTied = false
numLastRound = admin1.fields.item("round").value
strLastUsername = admin1.fields.item("username").value
admin1.movenext
do while not admin1.eof
numThisRound = admin1.fields.item("round").value
strThisUsername = admin1.fields.item("username").value
If Not numLastRound = numThisRound Then
boolTied = false
Else
boolTied = true
End If
%>
<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%
If boolTied = True Then
Response.Write "T"
End If
Response.Write numDisplayPos
%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=strLastUsername%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numLastRound%></font></b></td>
</tr>
<%
If Not numLastRound = numThisRound Then
numLastRound = numThisRound
numDisplayPos = numRealPos
End If

strLastUserName = strThisUserName
numRealPos = numRealPos + 1

admin1.movenext
loop
%>
<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%
If boolTied = True Then
Response.Write "T"
End If
Response.Write numDisplayPos
%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=strLastUsername%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=numLastRound%></font></b></td>
</tr>
<%
End If
%>
I think something like that will do what you want - expect a few syntax
errors and possible logic errors though. It's not particularly tidy, and
there may be better ways to achieve what you want, but it's a start :)

Jevon
"Jeff" <gi*****@adelphia.net> wrote in message
news:Lc******************************@adelphia.com ...
The solution you gave worked great, but now I have something more to add.
Is there a way to tell the script, that if 2 places do have the same
number, that it would put a T there? Like T4 meaning tied for 4th place?
"Jeff" <gi*****@adelphia.net> wrote in message
news:3-******************************@adelphia.com...
Ok gang, I am going to try and explain my question.

I have a page where a person's position is listed. This is what I am
using
to get that position.
I first sort by the round field in the DB, then I display the table on
the
page. The problem I have is, if there are say 2 people with the same
round
number, it continue's counting. For example
http://65.61.20.190/GIG/ladder/main.asp

see how the 4th and 5th place show the same number of laps )that is the
number in the round field in the DB), what I want is to show both of
them
with a 4. here is my script:
<%
set admin1 = conn.execute ("SELECT * FROM rounds where round > 0
ORDER
BY round DESC,username ASC")

%>
<div align="center">
<center>
<table border="0" cellpadding="2" style="border-collapse:
collapse"
width="27%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3">
<p align="center"><b>GIG Ladder Lap Count</b></td>
</tr>
<tr>
<td width="50%" align="center" nowrap><b><font
size="4">Pos</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Name</font></b></td>
<td width="50%" align="center" nowrap><b><font
size="4">Laps</font></b></td>
</tr>
<%
game = 1
do while not admin1.eof
var1 = admin1.fields.item("round").value
var2 = admin1.fields.item("username").value
%>

<tr>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=game%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var2%></font></b></td>
<td width="50%" align="center"><b><font size="4"
color="#C0C0C0"><%=var1%></font></b></td>
</tr>
<%
game = game + 1
admin1.movenext
loop
%>
</table>

as you can see game is the position column in the displayed table.
How can I have it show the same pos for a number that is the same, but
continue counting as if they were NOT the same. Meaning, if there was a
person below them, they would be in 6th place, since 2 are tied for 4th?
I hope this makes sense
Please help
Bam



Dec 13 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.