Newbies BMS3122 Posted April 25, 2009 Newbies Share Posted April 25, 2009 Can anyone provide an age calculation code for an FMP novice??? The way my mind works, I would use four(4)number fields: BirthYear, CurrentYear, BirthMonth and CurrentMonth. Find the DIFFERENCE between the related fields and voila... # of years & # months Just as people say, "I'm 29 years and 6 months." Well, I've tried all the permutations using my 4 fields but... Question 1: Is there a possible calculation code that would follow my mind's reasoning path : (Using the 4 fields) Question 2. How would FMP do this calculation : Specifically.. what fields do I need to create, what operators, and how do I write the formula for FMP's calculation editor I love FMP but I'm obviously in the twilight zone when it comes to calculations (although I've proudly done several S I M P L E ones!) This is important to me and your help would be a godsend. Link to comment Share on other sites More sharing options...
Lee Smith Posted April 25, 2009 Share Posted April 25, 2009 Start with this Thread. Link Link to comment Share on other sites More sharing options...
Nippon Maru Posted June 19, 2009 Share Posted June 19, 2009 Try this " Year " & (Year(Status(CurrentDate)) - Year(DOB) - If(Status(CurrentDate) < Date(Month(DOB); Day(DOB); Year(Status(CurrentDate))); 1; 0)) &"," & " Month " & (Mod(Month(Status(CurrentDate)) - Month(DOB) + 12 - If(Day(Status(CurrentDate)) < Day(DOJ); 1; 0); 12)) &"," & " Day " & (Today- Date(Month(Status(CurrentDate)) - (Day(DOB) > Day(Status(CurrentDate))); Day(DOB); Year(Today))) Link to comment Share on other sites More sharing options...
Raybaudi Posted June 19, 2009 Share Posted June 19, 2009 The Status ( ) functions aren't more alive. They were substituted by the Get ( ) functions. ALSO the Today function was substituted by the Get ( CurrentDate ) function. Note that there is even a typing error ( DOJ instead of DOB ) and that the "If" can be substituded by boolean evaluations. So, for years and months, you can try this UNSTORED calculation: Let([ today = Get ( CurrentDate ) ; Y = Year ( today ) ; M = Month ( today ) ; D = Day ( today ) ; yDOB = Year ( DOB ) ; mDOB = Month ( DOB ) ; dDOB = Day ( DOB ) ]; Y - yDOB - ( today < Date ( mDOB ; dDOB ; Y ) ) & " years and " & Mod ( M - mDOB + 12 - ( D < dDOB ) ; 12 ) & " months" ) Link to comment Share on other sites More sharing options...
Nippon Maru Posted June 20, 2009 Share Posted June 20, 2009 Thanks for your correction, I try that using old version of filemaker ver 6 Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 5422 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