troubleshooting Question

Month Difference

Avatar of pvsbandi
pvsbandiFlag for United States of America asked on
DB2
5 Comments1 Solution1458 ViewsLast Modified:
Hi,

   I have 2 dates in DB2 UDB 8.
 
I want to do this calculation in the select clause :

If month(date1) - month(date2) = 0 then 'OVERDUE'
If month(date1) - month(date)  = 2(example), then '2 Months OVERDUE'
If date1 = '09/02/2010' ( example) and date2 = '12/02/2008'(Example) then '21 Months OVERDUE'

Can someone kindly give me a solution to this?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros