473,326 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

ASP position question

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
8 1681
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Boniface Frederic | last post by:
Hello, I have frame displaying the last posted messages. I set <meta http-equiv="refresh" content="5"/> to automatically refresh the frame every 5s My problem is; if I scroll the frame to see...
1
by: Felix Natter | last post by:
hi, I have a structure like: <topic name="xxx"> <subtopic name="subxxx"> <subsubtopic name="subsubxxx"> </subsubtopic> </subtopic> </topic>
3
by: Matthias Lohrer | last post by:
Hi, my XML-Document hat this structure <book> <section> <para /> <para /> </section> <section> <para />
3
by: akunamatata | last post by:
Hello everyone, I contact this discussiongroup because I encountered a little problem with XSL. Let me explain it: I have following file "position.xml": <?xml version="1.0"?>...
6
by: Gérard Talbot | last post by:
Hello fellow stylers, When trying this page http://www.gtalbot.org/BrowserBugsSection/PercentualRelativePositioning.html I get different rendered layouts with IE 6, IE 7 beta 2, Firefox...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.