sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
ananthaisin's Avatar

Date function help subtracting dates


Question posted by: ananthaisin (Newbie) on August 16th, 2008 11:49 AM
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...
0 Answers Posted
Reply
Not the answer you were looking for? Post your question . . .
197,003 members ready to help you find a solution.
Join Bytes.com

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 197,003 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top DB2 Contributors