Order by more a requested variable
I need to be able to ORDER BY two different types of information
the first ORDER BY will be permanent and will never change. The second will be based upon a variable that is sent with the page. here is my sql statement...
orderby=request("orderby")
sql1 = "select preownedlistings.* from preownedlistings WHERE lactive=1 and listexpiredate > '"&date()&"' order by listingtype DESC,'" &orderby&"';"
The query seems to work fine and they are ordered by listingtype but not by the "orderby" variable, which in this case is a make of vehicle such as Honda, Ford...etc. they are still in random order not organized at all.
any suggestions?
|