Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting

Status
Not open for further replies.

YodaMan81

Technical User
Jul 8, 2003
94
US
Currently this is what I use to retrieve info:

rs.source = rs.source & ",@AcctNo='" & request.form("actno") & "'"

Can I change this to something like so I can sort from within the webpage itself?:

rs.source = rs.source & ",@AcctNo='" & request.form("actno") & "ORDER BY Field1" & "'"


-Thanks
 
Yes, but I dont seem to be getting anywhere with it. So I didnt even know if it was something that was possible.
 
It is hard to say what your problem is without knowing anything about what rs.source and actno are. The one suggestion I would offer based on what I can see is that you put a space before your ORDER BY clause, ie " ORDER BY field1
 
Well actually i am more concerned w/ knowing if this is actually possible.
But I take it that it is possible from your response. Am I wrong?

 
I am not entirely sure what you are trying to do, to be honest. However, if (as it looks to me) you are trying to append an ORDER BY clause to a query in some programming language, and then run the query against a database, then yes, it is possible.

However, if you are trying to do this, you might wish to look into the usage of Stored Procedures for your data retrieval.
 
Ok I guess more info would help the both of us.

Currently there is a page on our web that retrieves info using SQL.

The procedure is set up to automatically sort alphabetically when the info is displayed on the web.

Well there is another column on the info. that is pulled and sometimes i need to sort it using that column, which is the date. So i want to make a link available on teh page that gives the user the ability to sort by whatever you want.
It is exactly like this website. If you look on top you can sort the forum by "marked threads", "most recent threads" etc.....

basically that is what i need on the website and I have no clue how I can do it.
Thanks for you help btw!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top