Re: [PHP-DB] ordering date in varchar

[email protected] (Isaak Malik)
Newsgroups php.db
Organization EarthLabs
Message-ID <[email protected]>
> 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骞313 16:36
> To: [email protected]; php-db-digest-sc.1196674013.gdgkepajakejmghdjkad-vaibhavinformatics=gmail.com@lists.php.net; [email protected]
> 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?
> 
> 
For the best functionality and performance you should use date fields
for your database.

-- 
Isaak Malik
Web Developer
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.