You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Calculate Start date and lease period

posted on January 9, 2018

Hi,

I want to calculate the Start Date which is a date field and then Lease period which will be the amount of years (This drop down menu has values assigned 1 - 5 years) to show me the expiry date with the FX functions.

 

I have tried a few examples which I found on Answers, but not working as it should.

Regards,

Gert

0 0
replied on January 9, 2018

Hi Steve, 

 

Thank you very much for this, it works well. 

0 0
replied on January 9, 2018

Hi Gert, I think you meant to say you wanted to calculate the new Expiry date as the Start Date would be the starting point for the lease

This is the formula you would put in the Expiry Field. I'm assuming your Variable names matches the field names.

=DATE(YEAR(Start_Date)+Lease_Period,MONTH(Start_Date),DAY(Start_Date))

If you have no default value in the Lease Period Field this would produce the dreaded Calculation Field error, so to get around that you may add an If statement such as this

=IF(Period="",Start_Date,DATE(YEAR(Start_Date)+Lease_Period,MONTH(Start_Date),DAY(Start_Date)))

If you used a single line field instead of the Date field in Forms this opens us some different options as you must put a date value in a date field which is why I just populated it with the Start Date in the case that the Lease Period field was empty (no value selected)

I'd also suggest you set the Expiry field as Read only so that it can;t be changed manually by the user.

Hope this helps

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.