Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    14

    Unanswered: add months to particular date

    Hello All:

    Is there any equivalent of add_months in oracle, that can be used in DB2.

  2. #2
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    Wink Re: add months to particular date

    Hi Treddy

    I wouldn't know - I use db2.

    But if you specify what you want to do and
    on which platform - someone will surely be
    able to help you!
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  3. #3
    Join Date
    Jan 2004
    Posts
    14
    In oracle to add 2 months to the sysdate we execute the below statement.

    SQL> select add_months(sysdate, 2), sysdate from dual;

    ADD_MONTH SYSDATE
    --------- ---------
    31-MAY-04 31-MAR-04


    I want a similar function in DB2.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    CURRENT DATE + 2 MONTHS should give you ...

    SQL Reference is the manual you may want for SQL functions ... Please always take time to search in this manual before posting ... You may save considerable amount of your time and others' time ...

    Cheers
    Sathyaram

    Originally posted by treddy123
    In oracle to add 2 months to the sysdate we execute the below statement.

    SQL> select add_months(sysdate, 2), sysdate from dual;

    ADD_MONTH SYSDATE
    --------- ---------
    31-MAY-04 31-MAR-04


    I want a similar function in DB2.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •