kastellu Posted November 13, 2006 Share Posted November 13, 2006 Hello, Could someone help me with this one. I would like to change the order by when clicking on link.My code: <a herf = "index.asp?sort=asc">Products<%sort = request.querystring ("sort")If sort = asc then SORTBY = ascElseSORTBY = descsql ="SELECT * FROM tblExample ORDER BY '& SORTBY &';"%> Am i on a right way or did i lose it fully.Thank you Link to comment Share on other sites More sharing options...
justsomeguy Posted November 14, 2006 Share Posted November 14, 2006 Close. If sort = "asc" then SORTBY = "asc"ElseSORTBY = "desc"End If Link to comment Share on other sites More sharing options...
jesh Posted November 14, 2006 Share Posted November 14, 2006 You'll also need to specify which column you'll be sorting off of in the SQL query: SELECT * FROM tblExample ORDER BY columnName DESC Link to comment Share on other sites More sharing options...
kastellu Posted November 16, 2006 Author Share Posted November 16, 2006 O.K. thanks !But here is another problem, how to put value , back to first one, when you click on it again!thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now