Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 1988 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi,

I have a creation date field and I would like to add a year to it so if it was created on 01/01/2019 it actually says 01/01/2020.

I'm relatively new to FM so I am a bit puzzled as to what to do 

Thanks in advance for any help :)

Posted

Date ( Month ( table::myDate ) ; Day (table::myDate ) ; Year ( table::myDate ) + 1  ) 

  • Newbies
Posted

thanks A lot for the reply :) Is there away to make this work without me manual putting a date?

Currently that only seems to work if I select the date and then it adds a year to it. What I would like  to do is auto input the current date on a new record creation and then add the year to it if that makes sense?

Thanks alot!

  • Newbies
Posted

Hi :)

well "Date ( Month ( table::myDate ) ; Day (table::myDate ) ; Year ( table::myDate ) + 1  ) " only seems to work on my field  if I manually enter date.  I have to physically type 26/06/2019 for it to the display 26/06/2020.

What I would like to do is when i create a new record it automatically puts the date the current date into the field and then add one year so I don't have to type it in.

Does that make more sense? :)

Posted (edited)

Make the field auto-enter a calculated value =

Let (
today = Get ( CurrentDate )
;
Date ( Month ( today ) ; Day ( today ) ; Year ( today ) + 1 ) 
)

 

 

Edited by comment
Posted (edited)

Hi Gibson, keep in mind that, if the current date is a leap year then the resultant date will be one day later.  Example: current date is 2/29/2016, FM will automatically adjust it to 3/1/2017.  If you instead want a business rule that it should adjust backwards to the last day of February, you can do that too, similar to:

Let ( [
today = Get ( CurrentDate ) ;
d = Date ( Month ( today ) ; Day ( today ) ; Year ( today ) + 1 )
] ;
d - ( Month ( today )  ≠ Month ( d ) )
)

There are, of course, other calculations to achieve same result.  

Edited by LaRetta
Posted

 have a creation date field and I would like to add a year to 

Just to be clear, keep the creation date and add an additional date field "MyFutureDate" , auto-enter calc, to comment's suggested calc. 

This topic is 1988 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.