If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Datediff rounding

Started by jmills, 21 Jun 2012 11:52:03 AM

Previous topic - Next topic

jmills

I'm trying to calculate the difference between two dates using the following statement: datediff({year}, [date X], [date Y])

Due to the fact that i'm interested in the difference in the number of years, the calculation neglects the current month, therefore a difference in years between 2000-12--01 and today 2012-06-21 = 12.... however the answer should be 11 as we haven't yet reached December.

Is there a way to incorporate the day/month into this calculation?

Thanks

jmills

AHA!! I Found a slick solution!!!

datdiff({month}, [Date X], Date Y])12

basically, it finds the difference in the number of months, and divides by 12.