...

View Full Version : newest date first - mysql sort



crmpicco
03-04-2005, 11:09 AM
How do i sort a HTML table by date (newest date first).

This code below sorts oldest date first:

Set rs=con.execute("select * from trip_master where agencyid = '"&agencyid&"' and newdate > '" &new_date& "' and regular_trip <> 'Cancelled' order by date_of_booking desc limit 50")

but

Set rs=con.execute("select * from trip_master where agencyid = '"&agencyid&"' and newdate > '" &new_date& "' and regular_trip <> 'Cancelled' order by date_of_booking asc limit 50")

doesnt dort newest first. How do i get around this? Unfortunately it is in the DB as a varchar in format 'DD/MM/YY'

Picco

fractalvibes
03-04-2005, 05:28 PM
select YEAR(newdate) || '-' ||MONTH(newdate) || '-' || DAY(newdate) as blah
....

order by blah


fv



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum