Re: [help] covert to date ??

From: From the terminal emulator of Andrew Dowswell <dowswea_at_aa.wl.com>
Date: 15 Nov 93 23:11:28 -0400
Message-ID: <1993Nov15.231128.1_at_aa.wl.com>


Tina Lee writes:
> hi,

Hello there!

> I have a number field, stores julian date in format 'YYDDD', I want to convert
> it to date, I have tried "to_date(to_chart(julfield, '9999'), 'YYDDD')", but it
> does not work because, some of the julfield has 0 !!, how do I get around that
> problem please ??
>
> TL

Well, since you are going to be converting these "julfield"s to dates, you are going to have to pick a default value for the case where "julfield" is zero. Try this:

To_Date(To_Char(Decode(julfield,0,'defval',julfield),'9999'),'YYDDD')
                                   ^^^^^^
                      where this will be your default value.

Hope this helps.

Andy

-- 
 /---------------------------------------------------------------------------\
 | Andrew Dowswell     | "...They bring me numbness in their bright needles, |
 | Parke-Davis (CPO)   |  they bring me sleep. Now I have lost myself..."    |
 | dowswea_at_aa.wl.com   |                                                     |
 | (313) 996-1337      |             Sylvia Plath "Tulips"                   |
 \---------------------------------------------------------------------------/
 Disclaimer: The opinions of Parke-Davis are not necessarily my own, they
             should not be construed as mine and no flames should be directed 
             at me for something Parke-Davis has said or done.
Received on Tue Nov 16 1993 - 04:11:28 CET

Original text of this message