[PHP-DB] ordering date in varchar

2008-03-13 Thread Vaibhav Informatics
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? --

RE: [PHP-DB] ordering date in varchar

2008-03-13 Thread Liu, Hai Tao (Taylor)
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:[EMAIL PROTECTED] Sent: 2008年3月13日 16:36 To: php-db@lists.php.net; [EMAIL

Re: [PHP-DB] ordering date in varchar

2008-03-13 Thread Isaak Malik
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:[EMAIL PROTECTED] Sent: 2008年3月13日 16:36 To: php-db@lists.php.net;

[PHP-DB] RE: ordering date in varchar

2008-03-13 Thread Neil Smith [MVP, Digital media]
Message-ID: [EMAIL PROTECTED] Date: Thu, 13 Mar 2008 14:05:39 +0530 From: Vaibhav Informatics [EMAIL PROTECTED] 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?