PJ
|
| Posted: 03/09/2002, 1:23 AM |
|
Can anyone advise.
I am using the following in a SQL statement: DATE_FORMAT(datefield1, '%d %M
%Y')AS datefield1 ORDER BY datefield1 Desc
The problem I appear to have is that the sort is taking place on the 'day'
rather than the whole date. In other words 30 March 2002 is appearing
before 28 February 2002 which is before 26 April 2002. How can I sort this
field correctly?
PJ
|
|
|
 |
Alexey Alexapolsky
|
| Posted: 03/14/2002, 2:14 AM |
|
this should work , when you sort by date field name it workds ok , but
when you have an alias with the same name it overrides your field
with character data
DATE_FORMAT(datefield1, '%d %M
%Y')AS foo ORDER BY datefield1 Desc
--
Alex
CodeCharge Developer
"PJ" <apis@globalnet.co.uk> wrote in message
news:a6ckbe$brt$1@news.codecharge.com...
> Can anyone advise.
>
> I am using the following in a SQL statement: DATE_FORMAT(datefield1, '%d
%M
> %Y')AS datefield1 ORDER BY datefield1 Desc
>
> The problem I appear to have is that the sort is taking place on the 'day'
> rather than the whole date. In other words 30 March 2002 is appearing
> before 28 February 2002 which is before 26 April 2002. How can I sort this
> field correctly?
>
> PJ
>
>
|
|
|
 |
|