SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 28th, 2000, 03:03 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Sort by column SQL Question

<i><b>Originally posted by : Heather (hpoplin@hertz.com)</b></i><br />Does anyone know to code to sort by a column in a table when the column is clicked on? I saw a page that did that. I've read their code and can't figure out how they did it.<br /><br />Thanks.<br />

Reply With Quote
  #2  
Old December 19th, 2000, 08:00 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : </b></i><br />You can try this<br />1.Put your table displaying records inside a form<br />2.Submit your form on each click of col. header, for this you will have to give href to each colmn. heading.<br />3.Make sure that you have same form defined as action for form <br />4.Now when you are submitting form pass a parameter that will determine order by clause eg. if you want to sort on name pass sort=Name<br />5.Request this sort parameter in form & form a dynamic 'order by' condition on basis of requested parameter e.g.<br />if sort = "name"<br /> orderby="field_name"<br />end if<br />6.Now attach this condition at end of query retrieving records in your table<br /><br />Hope this works..<br />------------<br />Heather at 11/28/2000 1:03:15 PM<br /><br />Does anyone know to code to sort by a column in a table when the column is clicked on? I saw a page that did that. I've read their code and can't figure out how they did it.<br /><br />Thanks.<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Sort by column SQL Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT