Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Format Date Problem

Re: Format Date Problem

From: Paul Brewer <paul_at_paul.brewers.org.uk>
Date: Mon, 21 Apr 2003 20:42:47 +0100
Message-ID: <3ea4b3cf_3@mk-nntp-1.news.uk.worldonline.com>


"Jennifer" <jen_designs_at_hotmail.com> wrote in message news:ac419b20.0304210545.28268f0d_at_posting.google.com...
> How do I format a date stored into a table as:
>
> 2002-02-28 00:00:00.0
>
> into
>
> 02/28/2002
>
> The sql statement is:
>
> SELECT PAYPERIOD
> FROM PAYPERIOD_Table
> ORDER BY PAYPERIOD ASC
>
> Any help would be appreciated.
>
> Thanks
>
> Jennifer

Select to_char(payperiod,'MM/DD/YYYY')
FROM PAYPERIOD_Table
ORDER BY PAYPERIOD ASC to_char is formatting. Don't to_char the order by or you'll get them in alphabetical order rather than date order.

Regards,
Paul Received on Mon Apr 21 2003 - 14:42:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US