navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Sorting Column - Parameter not staying

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Sorting Column - Parameter not staying
Page: [1]
 
Grambo58

 

Posts: 19
Joined: 11/1/2007
From: Oregon
Status: offline

 
Sorting Column - Parameter not staying - 1/16/2008 1:22:47   
I'm using the great tutorial that is being shown all over this website.
http://www.frontpagemagic.com/DRW/Format/DynamicSorting/Index.asp

But when I go to add the value SUM(PlayerStats.Rush_Yards) to the parameter ::SortColumn:: , I don't get any results. When I go back into my query and look at the default settings, I see that the value for my SortColumn has dissapeared. I can't get anything to stay.

Also, when I click on the hyperlinks to sort my columns, I also have more "SUM()" values and it isn't displaying anything.

The tutorial doesn't explain how to do this. Can anyone help?

Here is my query before which works great.
quote:

SELECT PlayerStats.Name, SUM(PlayerStats.Rush_Att) AS Attempts, SUM(PlayerStats.Rush_Yards) AS Yards, ROUND(SUM(PlayerStats.Rush_Yards) / SUM(PlayerStats.Rush_Att),2) AS Average, SUM(PlayerStats.Rush_TD) AS Touchdowns FROM PlayerStats WHERE PlayerStats.Rush_Att > 0 GROUP BY PlayerStats.Name ORDER BY SUM(PlayerStats.Rush_Yards) DESC;


Here is my query after.
quote:

SELECT PlayerStats.Name, SUM(PlayerStats.Rush_Att) AS Attempts, SUM(PlayerStats.Rush_Yards) AS Yards, ROUND(SUM(PlayerStats.Rush_Yards) / SUM(PlayerStats.Rush_Att),2) AS Average, SUM(PlayerStats.Rush_TD) AS Touchdowns FROM PlayerStats WHERE PlayerStats.Rush_Att > 0 GROUP BY PlayerStats.Name ORDER BY ::SortColumn:: DESC;
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/16/2008 13:34:06   
Whenever an extended query is added, you need to also add the new parameter to the hyperlink.
Do you have a non working example we can see?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Grambo58)
Grambo58

 

Posts: 19
Joined: 11/1/2007
From: Oregon
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/16/2008 22:28:55   
Well, here is the working site. I have mixed aspx and asp. I'm in the middle of converting everything to asp since I can get the hyperlinks to work easier.
http://cascadefootball.net/stats/stats_defense.htm
If you click on either pull down menu and go to "Rushing" you will see the pages that I have used your tutorials for. (added hyperlinks) I will go back and create the one I had with sortable columns after I put the childrens to bed.

Okay, here is a link to one that I can't get to work.

http://cascadefootball.net/stats/sort.asp?SortColumn=SUM(PlayerStats.Rush_Att)

< Message edited by Grambo58 -- 1/17/2008 1:19:30 >

(in reply to Spooky)
Grambo58

 

Posts: 19
Joined: 11/1/2007
From: Oregon
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/23/2008 13:51:31   
Just wondering if anyone has had a chance to look. I'd really like to get the sort worked out.

(in reply to Grambo58)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/23/2008 14:19:49   
Im not sure what you are trying to do with that code?
You dont add SUM(PlayerStats.Rush_Att) - you add the actual vlaue you are filtering with

eg :

http://cascadefootball.net/stats/sort.asp?SortColumn=attempts

The DRW query is then based on ::SortColumn::

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Grambo58)
Grambo58

 

Posts: 19
Joined: 11/1/2007
From: Oregon
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/23/2008 19:25:32   
aha! I'll try that tonight!

(in reply to Spooky)
Grambo58

 

Posts: 19
Joined: 11/1/2007
From: Oregon
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/23/2008 21:52:50   
Well here is the problem I'm running into. In my query I have SUM(PlayerStats.Rush_Yards) as Yards... and then I have ORDER BY SUM(PlayerStats.Rush_Yards) DESC; My query works perfect. If I change it to ORDER BY Yards or ORDER BY [Yards] I don't return any results. This is why I used the Sum in the Query String.

Order By SUM(PlayerStats.Rush_Yards)
http://cascadefootball.net/stats/sort2.asp

Order By Yards
http://cascadefootball.net/stats/sort.asp

***Clarification*** These two pages are not using parameters. Just my SQL statements.

< Message edited by Grambo58 -- 1/24/2008 2:20:53 >

(in reply to Grambo58)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/24/2008 13:46:29   
How do you sort the columns? the drop down goes to an aspx page?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Grambo58)
Grambo58

 

Posts: 19
Joined: 11/1/2007
From: Oregon
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/25/2008 2:03:47   
Sorry, I got rid of those drop downs. They are only jump menus. They take you to pages that have pre-defined SQL querys. All of my pages have querys that are sorted in the DBW. I don't use any parameters to sort.

My query for Sort.asp that does not work:
quote:

SELECT PlayerStats.Name, SUM(PlayerStats.Rush_Att) AS Carries, SUM(PlayerStats.Rush_Yards) AS Yards, ROUND(SUM(PlayerStats.Rush_Yards) / SUM(PlayerStats.Rush_Att),2) AS Average, SUM(PlayerStats.Rush_TD) AS Touchdowns FROM PlayerStats WHERE PlayerStats.Rush_Att > 0 GROUP BY PlayerStats.Name ORDER BY Yards DESC;


My query for Sort2.asp that does work:
quote:

SELECT PlayerStats.Name, SUM(PlayerStats.Rush_Att) AS Carries, SUM(PlayerStats.Rush_Yards) AS [Yards], ROUND(SUM(PlayerStats.Rush_Yards) / SUM(PlayerStats.Rush_Att),2) AS Average, SUM(PlayerStats.Rush_TD) AS Touchdowns FROM PlayerStats WHERE PlayerStats.Rush_Att > 0 GROUP BY PlayerStats.Name ORDER BY SUM(PlayerStats.Rush_Yards) DESC;



The only thing I change to get it to return the results I need is the "ORDER BY" clause.

(in reply to Spooky)
Grambo58

 

Posts: 19
Joined: 11/1/2007
From: Oregon
Status: offline

 
RE: Sorting Column - Parameter not staying - 1/30/2008 23:38:25   
Has anyone had a chance to see what I'm doing wrong?

(in reply to Grambo58)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Sorting Column - Parameter not staying
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts