Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Decode
I've did the same when I had a similar problem determining which tax year a
date fell in - used SIGN and it worked a treat.
Mark
"John Darrah" <jdarrah_at_veripost.net> wrote in message
news:41a5f45dbc7e5fdc7f03f6e6c44a7adb.36240_at_mygate.mailgate.org...
> You can use DECODE along with SIGN to accomplish this. Example:
>
> SELECT SUM(DECODE(SIGN(mydate - SYSDATE),1,1,0,1,-1,0))
> FROM dual
>
> this decode statement basically states that if mydate is >= to sysdate
> then the column is equal to 1 otherwise it is equal to 0
>
>
>
> --
> Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Wed Apr 03 2002 - 17:33:39 CST
![]() |
![]() |