Hi,
Have a load of dates in the format DD/MM/YY. Thet are stored as a VARCHAR on
a mysql DB.
I need a way to sort them into order(most recent first)
Using the QUERY $query = SELECT doc_date FROM papers ORDER BY doc_date
DESC;
this just arranges them by day. e.g
30/12/2005
30/11/2005
You COULD sort them if the date was stored backwards, ie. Year/Month/Day
On 12/21/05, Jim Moseby [EMAIL PROTECTED] wrote:
Have a load of dates in the format DD/MM/YY. Thet are stored
as a VARCHAR on
a mysql DB.
I need a way to sort them into order(most recent first)
Using the
On 12/21/05, Ross [EMAIL PROTECTED] wrote:
Hi,
Have a load of dates in the format DD/MM/YY. Thet are stored as a VARCHAR on
a mysql DB.
Couldn't you use cast() to cast the values first? Something like (untested):
SELECT CAST(doc_date AS DATE) FROM papers ORDER BY doc_date DESC
c
--
PHP
3 matches
Mail list logo