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: Andrew Protasov <oracle_at_protasov.kiev.ua>
Date: Wed, 4 Nov 98 10:42:29 +0200
Message-ID: <ABrD1GsK42@protasov.kiev.ua>

Hi,

Try this:

SELECT
 TO_DATE(
 '31-DEC-'||
 TO_CHAR(ADD_MONTHS(TO_DATE('15-DEC-1997','DD-MON-YYYY'),18),          'YYYY'),
 'DD-MON-YYYY')
FROM DUAL; End of the yead is always December, 31, isn't it?

Andrew Protasov

> 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
Received on Wed Nov 04 1998 - 02:42:29 CST

Original text of this message

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