InfoPath – Difference between days

I had a request for a form to count the number of days between two date pickers as one of it’s functions. All that you need to make this happen is add two date picker controls and one text field to display the count. I have included an InfoPath sample form that explains this in detail and should provide you with the knowledge to add something like this to one of your forms.

I am unable to get this solution to work. I am able to enter the Start and End dates, however, the ‘dayDifference’ field is never displayed. I have double checked the formulas and rules and I’m at a loss.

I know this post is over 2 years old, but any help would be greatly appreciated.

Am new to InfoPath and found your solution. I followed your instructions but cannot get days difference. That is I cannot make work Daydifference for Main Rule and Finalize Rule. In the Field: field, your solution shows was appears to be a period or even a semicolon, that is not field but I cannot get that result and cannot type it in.

As you likely know if no value in this field then the I cannot save the rule. Would appreciate your help to understand and fix.

Please I cannot publish this form to a SharePoint list. I can only publish to a SharePoint library which does not allow editing in infopath. How can I publish it to a sharepoint list please so I can edit?

InfoPath publishes to libraries by default so I’m not sure what issue you are having. If you download the form and open it in design mode, you should be able to work with it. If you want to use this as a list, it will not work that way. You will need to first create a custom list and add the fields. Then, convert the list to an InfoPath form.