Jump to content
Server Maintenance This Week. ×

Date Calculation


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

Recommended Posts

I have created a date calculation field and want it to automatically calculate two years minus a day from another field:

i.e. Date: 25/12/2008 Calculation: 24/12/2010

If I add 730 days to the first field I sometimes get the right calculation but not always. I suspect leap years come into the equation but I'm not sure how to deal with this. Any help would be greatly appreciated.

Link to comment
Share on other sites

Technically, two years minus a day would be =

Date ( Month ( YourDate ) ; Day ( YourDate ) - 1 ; Year ( YourDate ) + 2 )

I say "technically", because there can be more that one correct answer to what is "two years minus a day" away from February 28/29 - it's largely a matter of preference. The above formula will return Feb. 28 if YourDate happens to be Feb 29, and Feb 27 when YourDate is Feb 28 (even if the the year of the result is a leap year).

Link to comment
Share on other sites

This topic is 5564 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.