CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Ordering dates

Print topic Send  topic

Author Message
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
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.