Calculate total number of days a vehicle is driven based on dates
In an Adobe form I am trying to calculate the number of days a vehicle is driven based on dates entered on multiple lines of the form. Vehicles may make multiple trips on one day, but only one day should be counted, not the number of trips. One trip may be made up of multiple days, so all days should be counted. This example should add up to 13 days driven. The form fields are named LeaveRow1 through LeaveRow20, and ReturnRow1 through ReturnRow20. The calculated field is DaysDriven. Can anyone provide the custom calculation script to make this work?
| Leave Date | Return Date |
| 10/1 | 10/1 |
| 10/2 | 10/2 |
| 10/3 | 10/8 |
| 10/9 | 10/9 |
| 10/9 | 10/10 |
| 10/10 | 10/13 |
