ordering dates

2007-09-12 Thread Ross Hulford
$result= mysql_query(SELECT date_format(date, '%d/%m/%Y') as date, title, id, display FROM news ORDER BY date DESC ); I have the query above the problem is oders them like so 30/05/2007 29/07/2007 25/0/2007 The order is taken by the first number. Is there any way to order them properly

Re: ordering dates

2007-09-12 Thread Michael Dykman
May I suggest: SELECT date_format(date, '%d/%m/%Y') as mydate, title, id, display FROM news ORDER BY date DESC changing the alias of your formatted date to mydate, the raw value of date is now available to order by. - michael dykman On 9/12/07, Ross Hulford [EMAIL PROTECTED] wrote: $result=

Re: ordering dates

2007-09-12 Thread Philip Hallstrom
$result= mysql_query(SELECT date_format(date, '%d/%m/%Y') as date, title, id, display FROM news ORDER BY date DESC ); I have the query above the problem is oders them like so 30/05/2007 29/07/2007 25/0/2007 The order is taken by the first number. Is there any way to order them properly

RE: ordering dates

2007-09-12 Thread Jerry Schwartz
: Wednesday, September 12, 2007 4:49 PM To: mysql@lists.mysql.com Subject: ordering dates $result= mysql_query(SELECT date_format(date, '%d/%m/%Y') as date, title, id, display FROM news ORDER BY date DESC ); I have the query above the problem is oders them like so 30/05/2007 29/07/2007 25