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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Order By problem with Dates

Re: Order By problem with Dates

From: Nicolas Bronke <news_at_TRINITY.de>
Date: Wed, 18 Aug 1999 16:36:02 +0200
Message-ID: <37bab7c5@news.uk.ibm.net>

<rock_cogar_at_my-deja.com> schrieb in im Newsbeitrag: 7pe8b3$pod$1_at_nnrp1.deja.com...
> I wish it was that easy. On Oracle 8.1.5 on NT 4.0 sp5, this is what I
> get from SQL Worksheet (1.3.5):
>
> SQLWKS> select distinct to_char(to_date(substr(to_char(s_date),1,4)||'-
> '||substr(to_char(s_date),5,2)||'-'||substr(to_char(s_date),7,2),'YYYY-
> MM-DD'),'Mon DD, YYYY')
> 2> from tssds.ehefmsam
> 3> where locdesc = 'MW-8'
> 4> order by S_DATE asc;
> order by S_DATE asc
> *

Do it more simple like

create or replace view TEST as
select distinct to_date(to_char(s_date),'YYYYMMDD' ) S_DATE from tssds.ehefmsam
where locdesc = 'MW-8'

then

select to_char(s_date,'MON DD,YYYY') from TEST order by S_DATE

or do it like

select to_char(s_date,'MON DD,YYYY')

from
(select distinct to_date(to_char(s_date),'YYYYMMDD' ) S_DATE from tssds.ehefmsam
where locdesc = 'MW-8')

order by S_DATE

Hope it helps.

regards

Nicolas Bronke Received on Wed Aug 18 1999 - 09:36:02 CDT

Original text of this message

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