Hi everyone, I have a form that displays the amount of days as seen in the image below. I believe because next year is a leap year the value is showing 366 days for a one year policy. I am having trouble with my formula right now. I want to display, 'If the calculated date is = 366, then subtract 1. I've tried a few ways and I'm not getting it to work. Any help is appreciated.
Here is the current formula below:
dateDiffDays(policyStartDate,policyEndDate)*If(greaterThan(policyStartDate,policyEndDate),-1,1) + " days"
Solved! Go to Solution.
could you explain why would you like/need to cheat this way?
the calculation is correct...
what would be expected result if end date was 09.Apr.2020? => 366? 367?
what would be expected result if start date is 28.Feb.2020 and end date 01.Mar.2020? => 1day? 2days?
what would be expected result if there were multiple leap years within the interval?
any details on the calculations?
do you only need to calculate full years (365 days)?
or does single days play a role? ie. is it important to know whether 366 days means 1 (leap) year or 1 year and 1 day?
someting similar was recently discussed in the other thread, have a look on that whether it wouldn't suit/inspire you