Gilbert Posted February 14, 2008 Posted February 14, 2008 My database has an age calculation field, which works fine. I enter the DOB: 8/1/2007 today it will display 1 Y, 0 M I need the calculation to display the age that the person will have in October 1 How can this be accomplished? GetAsText(Year(Get ( CurrentDate )) - Year(DOB) - If(GetAsNumber(Get ( CurrentDate ))< Date(Month(DOB); Day(DOB); Year(Get ( CurrentDate ))); 1; 0)) & " Y, " & GetAsText(Mod(Month(Get ( CurrentDate )) - Month(DOB) + 12 - If(Day(Get ( CurrentDate )) < Day(DOB); 1; 0); 12)) &" "&"M" I appreciate any help Thanks.
comment Posted February 14, 2008 Posted February 14, 2008 It can be accomplished by using the date of October 1 (which year??!) instead of Get (CurrentDate).
Gilbert Posted February 27, 2008 Author Posted February 27, 2008 (edited) DOB = 12/3/2004, Current age calculation = 3 Y, 2 M as today. New Calculation: GetAsText(Year(Target Date) - Year(DOB) - If(GetAsNumber(Target Date)< Date(Month(DOB); Day(DOB); Year(Target Date)); 1; 0)) & " Y, " & GetAsText(Mod(Month(Target Date) - Month(DOB) + 12 - If(Day(Target Date) < Day(DOB); 1; 0); 12)) &" "&"M" Target Date = 8/1/2008 -Global Date Field Age by August, 1 08 = 4 Y, 7 M Can you help me to fix this and in addition to calculate the days? Thanks Edited February 27, 2008 by Guest
comment Posted February 27, 2008 Posted February 27, 2008 Your calculation returns "3 Y, 7 M" here. In any case, I don't know what the correct result should be, so I wouldn't know how to fix it - see: http://www.fmforums.com/forum/showtopic.php?tid/189394/#263667
Recommended Posts
This topic is 6174 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