June 26, 20196 yr Newbies 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
June 26, 20196 yr Date ( Month ( table::myDate ) ; Day (table::myDate ) ; Year ( table::myDate ) + 1 )
June 26, 20196 yr Author Newbies 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!
June 26, 20196 yr Author Newbies 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?
June 26, 20196 yr Make the field auto-enter a calculated value = Let ( today = Get ( CurrentDate ) ; Date ( Month ( today ) ; Day ( today ) ; Year ( today ) + 1 ) ) Edited June 26, 20196 yr by comment
June 26, 20196 yr 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, 20196 yr by LaRetta
June 26, 20196 yr 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.
Create an account or sign in to comment