Raybaudi Posted September 28, 2005 Posted September 28, 2005 (edited) Hi all friends does someone know if there are international rules for the birthday of a person born on february 29 ? I think that if a baby was born on 02/29/2000, his birthdays were: 02/28/2001 firts year 02/28/2002 second year 02/28/2003 third year 02/29/2004 forth year ( on 02/28/2004 he was 3 years old) If what I think is right (internatinal rule), the calc for the age in years format: Year(theDate) - Year(birthday) - (theDate < Date(Month(birthday); Day(birthday); Year(theDate))) is always good except in this case. Edited September 29, 2005 by Guest typo corrected
Raybaudi Posted September 28, 2005 Author Posted September 28, 2005 Anyway this code does the trick: Let([ y1 =If ( Mod( Year ( birthday ) ; 4 ) = 0 ; 1 ; 0 ); y2 =If ( Mod ( Year ( theDate ) ; 4 ) = 0 ; 1 ; 0 ); d = If(Day ( birthday ) = 29;1;0); m = If( Month ( birthday ) = 2;1;0); cd = If(y1 *y2 = 0 and d * m = 1;Date ( Month ( birthday ) ; Day ( birthday ) - 1 ; Year ( birthday ) );birthday) ]; Year(birthday) - Year(cd) - (theDate < Date(Month(cd); Day(cd); Year(theDate))) )
-Queue- Posted September 28, 2005 Posted September 28, 2005 Just a tip, Daniele. All of your Let vars up to and including m are boolean statements in their own right. So you can use y1 = not Mod( Year(birthday); 4 ); y2 = not Mod( Year(theDate); 4 ); d = Day(birthday) = 29; m = Month(birthday) = 2;
Lee Smith Posted September 28, 2005 Posted September 28, 2005 Hi all friends does someone know if there are international rules for the birthday of a person born on february 29 ? I think that if a baby was born on 02/29/2000, his birthdays were: 02/28/2001 firts year 02/28/2002 second year 02/28/2003 third year 02/29/2004 forth year ( on 02/09/2004 he was 3 years old) If what I think is right (internatinal rule), the calc for the age in years format: Year(theDate) - Year(birthday) - (theDate < Date(Month(birthday); Day(birthday); Year(theDate))) is always good except in this case. I think the answer should be 3 Years, 11 Months, 11 Days on Feb 9, 2004. What answer are you looking for. Lee
Raybaudi Posted September 29, 2005 Author Posted September 29, 2005 Hi Lee just a typo...I had to write: 02/29/2004 forth year ( on 02/28/2004 he was 3 years old)
Recommended Posts
This topic is 7062 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