|
| |
|
|
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;
|
|
|
|
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 >
|
|
|
|
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.
|
|
|
|
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!
|
|
|
|
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 >
|
|
|
|
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.
|
|
|
|
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?
|
|
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
|
|
|