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- Please Help

Re: Decode- Please Help

From: Jurij Modic <jmodic_at_src.si>
Date: Wed, 04 Nov 1998 08:49:21 GMT
Message-ID: <36401039.2857357@news.siol.net>


On Wed, 04 Nov 1998 04:18:07 GMT, lakkundi_at_msn.com wrote:

>Need to write a select statement that takes a date (eg. 15-DEC-97) and adds
>18 months to it. It must then print out the year-end (DEC 31) of that
>addition. For example, 18 months from Dec. 15 1997 is June 15, 1999, but the
>year-end result that would be displayed is Dec. 31, 1999.
>
>
>I can write this with date functions but I need to make it more dynamic with a
>decode.
>How do I do this. I tried and tried, please help..
>
>Thanks so much for your help

I can't see any conditional logic required in your description of a problem. Can you explain in more detail what would the DECODE be used for?

And what can be more general sollution for your problem as using simple date functions? Eg

SELECT ADD_MONTHS(TRUNC(ADD_MONTHS(sysdate,18),'YEAR'),12)-1 FROM dual;

HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Wed Nov 04 1998 - 02:49:21 CST

Original text of this message

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