Re: sort by date

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Stokes wrote:
Hello,

I made a mistake and stored date information to DB as varchar values (dd.mm.yyy). When I read the DB is it still possible to sort the data by date with SQL query (ORDER BY date ASC)? Or is it nessessary to have the date information to be stored as a date in the DB? Will it work or is the output going to be sorted randomly?

It would be sorted by day first, then month, then year.

Add another column (DATE type) to the table and update it from the current column using SUBSTRING() function.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux