Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Decode

Re: Decode

From: M Baker <noreply_at_nowhere.com>
Date: Thu, 4 Apr 2002 00:33:39 +0100
Message-ID: <3cab9119$0$233$cc9e4d1f@news.dial.pipex.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US