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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ordering an SQL statement

Status
Not open for further replies.

moo

Programmer
Sep 11, 2000
4
0
0
GB
I have a table with columns called username and page_name. The columns look like this:

Username Page_Name
dave algarve 09/09/00
dave algarve 09/08/00
dave algarve 08/10/00
dave algarve 07/00/00

As you can see the page_name is not in order of descending order (08/10/00) should be at the top. The field is not a date field it is a varchar. Is there any way I can order this. There is also another column in this table called url_extension which would be algarve090900.shtml for Algarve 09/09/00 if it would be easier to order by this column. [sig][/sig]
 
split the column you want to sort on using substr

then you can order it anyway you want

what database are you using? [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top