RE: [PHP-DB] ordering date in varchar
| From: | Taylor) | Date: | Thu, 13 Mar 2008 08:50:47 +0000 |
| Subject: | RE: [PHP-DB] ordering date in varchar | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44742@lists.php.net to get a copy of this message | ||
I think you can try the SQL:
Select STR_TO_DATE([field_name], '%d/%m/%Y') as newDate , [field_name] from [table] order
by newDate asc;
Thanks,
Haitao
-----Original Message-----
From: Vaibhav Informatics [mailto:vaibhavinformatics@gmail.com]
Sent: 2008年3月13日 16:36
To: php-db@lists.php.net;
php-db-digest-sc.1196674013.gdgkepajakejmghdjkad-vaibhavinformatics=gmail.com@lists.php.net;
php-db-digest-help@lists.php.net
Subject: [PHP-DB] ordering date in varchar
We have a problem. We have given the dates as date.month.year eg 27.12.2007
The field is named as varchar. We have to arrange ths list of dates in
ascending order. Can anyone help? Varchar arranges the list by scanning from
left side. Perhaps scanning from right side will do. How to do it?
--
Vaibhav Informatics, 109 Vasant Plaza, Munirka, Near Subway, New Delhi-110
067 Ph: 011-26194466 Email :vaibhavinformatics@gmail.com