Re: about nvl2 function

From: riverdance <esthershensh_at_yahoo.com>
Date: Tue, 8 Jun 2010 10:02:36 -0700 (PDT)
Message-ID: <4a52dbf6-84fc-468e-9eb1-032c6bb6a397_at_e5g2000yqn.googlegroups.com>



On Jun 8, 10:45 am, riverdance <esthershe..._at_yahoo.com> wrote:
> HI,
>
> sorry , I'm new to oracle world..
>
> who could help explain following.. I expected following SQL would
> error out.. but I got following result.
>
>  I don't understand, how date format string '1/1/2010' could convert
> to number .000497512, and how date format string 1-1-2010 could
> convert to number -2010?
>
> SQL> select nvl2(birth_dt,0,1/1/2010) from eshen.test;
>
> NVL2(BIRTH_DT,0,1/1/2010)
> -------------------------
>                .000497512
>                .000497512
>
> SQL> select nvl2(birth_dt,0,1-1-2010) from eshen.test;
>
> NVL2(BIRTH_DT,0,1-1-2010)
> -------------------------
>                     -2010
>                     -2010

thanks. it's and expression, not date here. Thanks. Received on Tue Jun 08 2010 - 12:02:36 CDT

Original text of this message