3 Replies Latest reply on Dec 1, 2016 3:07 AM by Ashish Chaudhari

# No. of Days between two dates

Hi,

I was trying to calculate days difference between two dates but couldn't get result when there is weekend between those 2 dates.

Highlighted the ones I am getting wrong output.

 Assigned Date Completed  Date Days   Taken (Actual) Days    Taken(Current) 11/16/2016 11/17/2016 1 1 11/16/2016 11/18/2016 2 4 11/18/2016 11/21/2016 1 1 11/9/2016 11/16/2016 6 8

Note: Need to exclude Sat and Sun.

Thanks,

Kumar

• ###### 1. Re: No. of Days between two dates

Try this KB article to calculate number of business days between two dates.

• ###### 2. Re: No. of Days between two dates

Hi Kumar,

This is bit difficult since the dates are not continuous. Thus its getting tough to find if difference contains the Saturday or Sunday.  Consider if the date difference comes to 30-35 then we need to subtract 8. Trying to find a way out. Normal Datediff will not help. It requires many cases to be considered.

-Ashish

• ###### 3. Re: No. of Days between two dates

Hi Kumar,

Please find the below screenshot for your reference. I have assumed that your work doesn't complete on any of the weekend. It simple means that this calculations will work for you only if completed date isn't Saturday or Sunday. Also to correct you in the question section, for last entry date difference is 5 and not 6. (Wed to next Wed will be 7 and subtract 2 weekends. So answer is 5).

Let me know if this work for you. I can help you to solve this.

Kindly take a note that I have Default weekstart set to Monday. Please put light on when does your week start in case its not a monday.

Thanks and Regards,

Ashish Chaudhari