Wrox Programmer Forums
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 9th, 2004, 11:31 PM
Authorized User
Join Date: Oct 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sort Records Based on Totals

Hey guys,

I have run into a bit of a problem. I am working on a website for a sports team and am stuck on the statistics page. I have my database setup with several tables, including seperate roster, statistics, and schedule tables. The roster has a field (rosterid) that is used to identify each player.

I wanted to have it setup so that each game's stats for each player are kept. So here is the problem. The first page for the stats that my visitors should see should have the totals for all the players listed in order of who has the most points. Then, if the visitor clicks on the player name, it will take them to another page that lists the statistics for that player for each individual game.

I am unsure of how to do the first part. I know how to create the page for the individual player with no problem. I do not know how to create the first page that totals up each stats category and then orders the list of players by who has the most points. I am pretty sure that there has to be a way to to this but I am unsure about how to start. Any ideas or help is greatly appreciated. Thanks!

Michael W. Vollmer
Michael W. Vollmer
Old July 11th, 2004, 11:22 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Hi There,

Not sure If you are using ACCESS or SQL server.

May be you can use a Query that lists the top 10 or so players who has top points.

Select Top 10 PlayerNames, PlayerId from PlayersTable Order by PointsAchieved Desc
This results in top 10 players list and You can pass each player's PlayerID as querystring when clicked on any of those players.

Hope that helps

- Vijay G
Strive for Perfection

Similar Threads
Thread Thread Starter Forum Replies Last Post
User selection to sort records in a Crystal Report MisterN Crystal Reports 1 January 24th, 2007 01:03 PM
Change Sort-by attribute based on parent tclancy XSLT 2 March 24th, 2006 05:00 PM
how to sort cross tab.sort based on row total joxa83 Crystal Reports 7 March 2nd, 2006 09:12 AM
View records based on formula deepakbhota Crystal Reports 0 August 11th, 2005 08:35 AM
select records based on list dodorisio SQL Server 2000 7 December 13th, 2003 01:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.