472,353 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

sorting help

ok gang. I have this code to get the data from mssql db

set standings1 = conn.execute("select points, team, wins, losses, win_pct
from tblStats order by wins desc, points desc, team asc")
numRealPos = 0
numDisplayPos = 1

do while not standings1.eof
var_P = standings1.fields.item("points").value
var_T2 = trim(standings1.fields.item("team").value )
var_W = standings1.fields.item("wins").value
var_L = standings1.fields.item("losses").value
var_PCT = standings1.fields.item("win_pct").value

numRealPos = numRealPos + 1
If Not var_W = numLastValue Then
numLastValue = var_W
numDisplayPos = numRealPos
End If

now, this does sort the data by the wins.... but i would like to actually
sort it by wins, then points.

i use this script because if 2 teams have the same amount of wins, it shows
them as the same place. so i want to include the points as well. then it
wold only show the same place if both wins and points are the same.

let me show an example of what i mean.
http://clanwars.gig-gamers.com/standings.asp

it shows the rank, which is the numDisplayPos based on the wins.

if you look at the table on the right, it shows the last 2 teams as tied.
they have the same amount of wins. but one team has more points, so should
be higher on the rank. i only want it to show the same rank if both wins and
points are the same values.

hope this makes sense.

TIA
Jeff
Jun 26 '06 #1
1 1170
dang,,, was hoping to get some assistance on this. :(
"Jeff" <gi*****@adelphia.net> wrote in message
news:1t******************************@adelphia.com ...
ok gang. I have this code to get the data from mssql db

set standings1 = conn.execute("select points, team, wins, losses, win_pct
from tblStats order by wins desc, points desc, team asc")
numRealPos = 0
numDisplayPos = 1

do while not standings1.eof
var_P = standings1.fields.item("points").value
var_T2 = trim(standings1.fields.item("team").value )
var_W = standings1.fields.item("wins").value
var_L = standings1.fields.item("losses").value
var_PCT = standings1.fields.item("win_pct").value

numRealPos = numRealPos + 1
If Not var_W = numLastValue Then
numLastValue = var_W
numDisplayPos = numRealPos
End If

now, this does sort the data by the wins.... but i would like to actually
sort it by wins, then points.

i use this script because if 2 teams have the same amount of wins, it
shows them as the same place. so i want to include the points as well.
then it wold only show the same place if both wins and points are the
same.

let me show an example of what i mean.
http://clanwars.gig-gamers.com/standings.asp

it shows the rank, which is the numDisplayPos based on the wins.

if you look at the table on the right, it shows the last 2 teams as tied.
they have the same amount of wins. but one team has more points, so should
be higher on the rank. i only want it to show the same rank if both wins
and points are the same values.

hope this makes sense.

TIA
Jeff

Jun 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors...
9
by: jwedel_stolo | last post by:
Hi I'm creating a dataview "on the fly" in order to sort some data prior to writing out the information to a MS SQL table I have used two methods...
12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort...
2
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am...
4
by: FBM | last post by:
Hi, I am working on a program that simulates one of the elements of ATM. The simulation stores events which occurs every some milliseconds for a...
4
by: Ambica Jain | last post by:
Hi, I want custom sorting on some of the columns in the datagrid. And i am able to do the same by overriding MouseDown event. However, i need to...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule...
6
by: =?Utf-8?B?RGFu?= | last post by:
I am reposting a question from about 3 weeks ago ("sorting capability"). I have an aspx page in which I get the data from a database dynamically,...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

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.