Newbies Gibson Posted June 26, 2019 Newbies Posted June 26, 2019 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
Ocean West Posted June 26, 2019 Posted June 26, 2019 Date ( Month ( table::myDate ) ; Day (table::myDate ) ; Year ( table::myDate ) + 1 )
Newbies Gibson Posted June 26, 2019 Author Newbies Posted June 26, 2019 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 Gibson Posted June 26, 2019 Author Newbies Posted June 26, 2019 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?
comment Posted June 26, 2019 Posted June 26, 2019 (edited) Make the field auto-enter a calculated value = Let ( today = Get ( CurrentDate ) ; Date ( Month ( today ) ; Day ( today ) ; Year ( today ) + 1 ) ) Edited June 26, 2019 by comment
LaRetta Posted June 26, 2019 Posted June 26, 2019 (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 June 26, 2019 by LaRetta
bcooney Posted June 26, 2019 Posted June 26, 2019 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now