cancel
Showing results for
Did you mean:
Highlighted
Nintex Newbie

## The Leap Year Result value return a problem for my form

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"

Labels: (1)
• ### Forms

4 Replies
Highlighted
Automation Master

## Re: The Leap Year Result value return a problem for my form

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?

Highlighted
Nintex Newbie

## Re: The Leap Year Result value return a problem for my form

Ok this control is for a Yearly Quote Generator, we would generate a quote based on that year/365 day period, but now since next year is a leap year its throwing off agents that use this Quote generator when they select certain dates.

1. It would be 367
2. 2 days
3.
Highlighted
Automation Master

## Re: The Leap Year Result value return a problem for my form

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

https://community.nintex.com/t5/Nintex-for-SharePoint/Help-with-a-complex-calculation-based-on-a-few...

Highlighted
Nintex Newbie