cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
michaelbah40
Nintex Newbie

The Leap Year Result value return a problem for my form

Jump to solution

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.

 

 

snippet.png

 

Here is the current formula below:

 

dateDiffDays(policyStartDate,policyEndDate)*If(greaterThan(policyStartDate,policyEndDate),-1,1) + " days"

 

 

 

Labels: (1)
0 Kudos
Reply
4 Replies
emha
Nintex Newbie

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

Jump 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?

0 Kudos
Reply
michaelbah40
Nintex Newbie

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

Jump to solution
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.
0 Kudos
Reply
emha
Nintex Newbie

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

Jump to solution

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...

0 Kudos
Reply
michaelbah40
Nintex Newbie

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

Jump to solution
Good Morning Emha,

Only needs to calculate 365 days for this annual policy system. If April 16, 2019 to April 16 2020 equals a leap year then the system needs to either subtract one day automatically or the user needs to be warned and make the manual adjustment I'm thinking. The system has to know when the leap years have occurred.

I will check out this example right now....get right back to you if this solves my issue.
0 Kudos
Reply