If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > add months to particular date

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-31-04, 03:00
treddy123 treddy123 is offline
Registered User
 
Join Date: Jan 2004
Posts: 14
add months to particular date

Hello All:

Is there any equivalent of add_months in oracle, that can be used in DB2.
Reply With Quote
  #2 (permalink)  
Old 03-31-04, 04:00
Tank Tank is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 03-31-04, 04:06
treddy123 treddy123 is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 03-31-04, 04:52
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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

Quote:
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On