COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Web2CRM on 27 Mar 2014 06:03:23 AM

Title: Date Difference for weekdays only
Post by: Web2CRM on 27 Mar 2014 06:03:23 AM
Hi Cognos Gurus,

I need some help on date calculation between two dates but I need to exclude weekends in the calculation result.

I used the _days_between ([Date1],[Date2]) to get the date difference, I am not sure how to exclude weekends.

ex: March 10, 2014 and March 17, 2014 - the result should be 5 (weekends not included)

Thanks in advance...
Title: Re: Date Difference for weekdays only
Post by: BigChris on 27 Mar 2014 06:12:57 AM
Calculate the number of weeks between the two dates and subtract 2 * that number of days from your original calculation
Title: Re: Date Difference for weekdays only
Post by: Ammus1234 on 27 Mar 2014 06:34:22 AM
This may help. http://www-01.ibm.com/support/docview.wss?uid=swg21342343
Title: Re: Date Difference for weekdays only
Post by: Web2CRM on 27 Mar 2014 10:01:41 AM
Ammus1234,

The syntax in the link you provided was perfect.. Thanks a lot guys!!!