Cognito-forms – Leave request form (same date entry shows zero)

cognito-forms

I am trying to create a leave request form on Cognito.
Say the employee is taking 9/8/16 off and proceeds to put in start date as 9/8/16 and end date 9/8/16, the result is 0 from this calculation:

=(EndDate-StartDate).Days

How do I make the count 1 with the =(StartDate=EndDate)?

Best Answer

I'm a developer with Cognito Forms.

Your very very close with the calculation you currently have. You just need to add a day to your calculation so that a start date of 9/8/16 and an end date of 9/8/16 will give you one day, this will work for the rest of your entered dates as well.

A start date of 9/8/2016 and an end date of 9/10/2016 will give you 3 days. You can check out the updated calculation below and a link to a demo template.

=(EndDate - StartDate).Days + 1

https://www.cognitoforms.com/templates/shared/CognitoFormsTestAccount/LeaveRequestDemo