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 Using a Date Comparison? Any ideas?

Re: DECODE Using a Date Comparison? Any ideas?

From: Matt Brennan <mbrennan_at_gers.antispam.com>
Date: Thu, 30 Jul 1998 17:07:27 GMT
Message-ID: <01bdbbdc$8bb90680$049a0580@mcb>


Yes - the one below should work. DECODE won't handle ranges of values (like using > or < operators), but you can fake it out into doing so by using the sign function.
--
Matt Brennan
SQL*Tools Specialist
GERS Retail Systems
9725-C Scranton Road
San Diego, California 92121
1-800-854-2263
mbrennan_at_gers.com
(Original email address is spam-blocked.)

Mauro <sbffn_at_vgf.vg> wrote in article <35c08fea.100941476_at_news>...
> On Thu, 30 Jul 1998 15:14:48 GMT, mark_tortolano_at_dial.pipex.com wrote:
>
> -snip-
> >What I would like to do is ...
> >I tried a DECODE that looked like this, but it doesn't work:-
> >DECODE(((TO_DATE(datesuspendstart+numsuspendduration))>SYSDATE),1,0,0)
>
> Try:
>
> DECODE(sign(TO_DATE(datesuspendstart+numsuspendduration)-SYSDATE),
> 1,'greater than',
> 0,'equal to',
> 'less than')
>
> --
> Mauro.
>
> (My return address is intentionally invalid; ROT13 is required.
> As someone already told this audience, my responses are not to be
> considered official technical support or advice.)
>
Received on Thu Jul 30 1998 - 12:07:27 CDT

Original text of this message

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