Re: about nvl2 function

Giganews Newsgroups
Subject: Re: about nvl2 function
Posted by:  riverdance (esthershen…@yahoo.com)
Date: Tue, 8 Jun 2010

On Jun 8, 10:45=A0am, riverdance <esthershe.…@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.
>
> =A0I 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)
> -------------------------
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.000497512
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.000497512
>
> SQL> select nvl2(birth_dt,0,1-1-2010) from eshen.test;
>
> NVL2(BIRTH_DT,0,1-1-2010)
> -------------------------
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -2010
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -2010

thanks. it's and expression, not date here. Thanks.

Replies

None

In response to

about nvl2 function posted by riverdance on Tue, 8 Jun 2010