adyf Posted January 31, 2009 Posted January 31, 2009 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.
comment Posted January 31, 2009 Posted January 31, 2009 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).
adyf Posted January 31, 2009 Author Posted January 31, 2009 Thanks for the reply, that's exactly what I was after. Easy when you know how I guess.
Recommended Posts
This topic is 5834 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