473,396 Members | 1,754 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,396 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 1214
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 sorted_feature_vector=feature_vectors.keys()...
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 in order to determine the sort order of the...
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 expression for each field as the anme of that...
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 having some issues trying to sort the child...
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 confused as to how I would provide functionality to...
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 certain amount of time. Every time that an event...
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 rebind my datatable to reflect the changes in...
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 (display:none). When one clicks in the left of the...
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, through C# code, by creating a dynamic table...
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 remove code that I think controls how many colums...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.