4 Replies Latest reply on Jul 25, 2015 12:39 PM by jbrown

# How do I calculate a date one year after the date in another field?

I've been staring at the various Date functions, but can't seem to do the simple task of adding one year (when a membership expires) to the date of a renewal in another field. I realize this is simple, but I'm even simpler, and used to Panorama and Excel.

• ###### 1. Re: How do I calculate a date one year after the date in another field?

I think I figured it out right after posting the question! Just being around the FMP discussion forum has made me smarter!

Here's my answer: Date(Month(NewRenewDate);Day(NewRenewDate);Year(NewRenewDate) +1)  where NewRenewDate is the date of a renewal or new membership.

• ###### 2. Re: How do I calculate a date one year after the date in another field?

Date (

Month ( yourDate ) ;

Day ( yourDate ) ;

Year ( yourDate ) + 1

)

• ###### 3. Re: How do I calculate a date one year after the date in another field?

Yes! the date addition (or subtraction) works really well when applied to month, day and/or year. It accounts for leap day/years, & months with different #days.  28 FEB + 1 year may be 01 MAR the next year, for example.

• ###### 4. Re: How do I calculate a date one year after the date in another field?

You found a great way. Kudos!

FYI: A lot of developers put the NewRenewDate in a variable. I might restructure your statement to look like this:

Let ([

_Date = NewRenewDate

];

Date( Month (_Date) ; Day (_Date) ; Year (_Date) + 1)

)

The advantages are that _Date is much easier to type than something else, though with FM14, it goes away a bit, It is easier to read, In my opinion, and if you were using Get(CurrentDate) the calc engine only has to find the current date once, rather than for each parameter of the date function.

Just a tip. The Let statement is invaluable.