Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 16th, 2008, 11:49 AM
Newbie
 
Join Date: Aug 2008
Posts: 6
Default Date function help subtracting dates

I am having the below oracle statement

TO_DATE(to_char(last_day(add_months(sysdate-1,-1))+1,'dd-mon-YYYY'),'dd-mon-YYYY')-ACT_DATE

to update a column...

But in Db2 this does not work,i found a roundabout method or duno if its good..

days(((current_date - day(current_date) day)+1 day))-days(date(act_date))

The column is to be updated with the no of days from the start of the month(even if its 15th of the month)...

But how can i use last_day and add_months function in the above i am stuck at thissss...
Reply
Reply

Bookmarks

Thread Tools

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 Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles