Re: need help with a number conversion

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Tue, 11 Dec 2001 16:09:12 GMT
Message-ID: <IcqR7.32881$ER5.373332_at_rwcrnsc52>


You have a number not a date.
You can do
select
decode(mydayfield,1,'Sunday',2,"Monday',3,'Tuesday',4,'Wednesday',5,'Thursda y',6,'Friday',7,'Satuday','') from ...
Jim
"Adam Hapworth" <hap_at_mikomi.org> wrote in message news:a6cb04db.0112110709.47542b8c_at_posting.google.com...
> I am having a hard time trying to make this work.
>
> I have a number 1-7 for each day of the week in a database. I want to
> turn that into the 'day' format so 1 = 'sunday' and so on. I have
> tried a number of different ways but none of them work. I need this
> to do the next_day() function in oracle 8
>
> to_date(2,'day')
> ORA-01846: not a valid day of week
>
> to_char(2,'day')
> ORA-01481: invalid number format model
>
>
> any ideas will help
Received on Tue Dec 11 2001 - 17:09:12 CET

Original text of this message