Results 1 to 2 of 2
MYSQL!! how to order by DESC or ASC with 12-07-2007 10:00:00 (dd-mm-yyyy hh:mm:ss)
i store dat-time in birthday filed with varchar type and store data format 12-07-2007(dd-mm-yyyy hh:mm:ss) and try ...
- 07-05-2007 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 84
Please !!! MYSQL!! how to order by DESC or ASC with 12-07-2007(dd-mm-yyyy hh:mm:ss)
MYSQL!! how to order by DESC or ASC with 12-07-2007 10:00:00 (dd-mm-yyyy hh:mm:ss)
i store dat-time in birthday filed with varchar type and store data format 12-07-2007(dd-mm-yyyy hh:mm:ss) and try to query order by desc or asc not working
How to
1. my field store date-time that varchar and (dd-mm-yyyy hh:mm:ss) only
- 07-05-2007 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
You should consider changing that field data type. The date format is valid for youse with datetime.
In the meantime -
Where $columname is your varchar column you want as datetime, "Time" is an alias you are giving it and it is ordered descending by column 1 (out of one column).Code:select cast($columname As DateTime) "Time" order by 1 desc


Reply With Quote