Forums

ASP

This topic is locked

Sorting Two Columns In Same Table

Posted 20 Sep 2002 16:00:00
1
has voted
20 Sep 2002 16:00:00 T Bone posted:
I need to sort the values of two different fields of the same table in a combined fashion. How can I do this with one recordset? I do not want to make a rs for one field and another rs for the other field. I need all the data in both fields merged, then sorted.

Replies

Replied 23 Sep 2002 10:39:19
23 Sep 2002 10:39:19 Vince Baker replied:
If you want to sort by more than one field do the following:

In your recordset:


Select *
FROM YourTable
ORDER BY Field1 ASC, Field2 ASC

You can add as many fields as you want and to change from ascending to descending change the ASC to DESC.



Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting

Reply to this topic