Newbies bugsbunnyy Posted July 19, 2001 Newbies Posted July 19, 2001 Another likely easy question (I'm new to FM) I have 2 fields, today's date and date of birth. How can I calculate a person's age based on these 2 fields? Thanks [email protected]
Chuck Posted July 19, 2001 Posted July 19, 2001 This is a calculation that will do what you need: code: If(IsEmpty(Birthdate), "", NumToText( Year(Status(CurrentDate)) - Year(Birthdate) - Case(Status(CurrentDate)< Date(Month(Birthdate), Day(Birthdate), Year(Status(CurrentDate))), 1, 0) ) & " Years, " & NumToText( Mod(Month(Status(CurrentDate)) - Month(Birthdate) + 12 - Case(Day(Status(CurrentDate)) < Day(Birthdate), 1, 0), 12) ) & " Months, " & NumToText( Day(Status(CurrentDate)) - Day(Birthdate) + Case(Day(Status(CurrentDate)) >= Day(Birthdate), 0, Day(Status(CurrentDate)- Day(Status(CurrentDate))) < Day(Birthdate), Day(Birthdate), Day(Status(CurrentDate)- Day(Status(CurrentDate)))) ) & " Days" ) Chuck
Garry Claridge Posted July 20, 2001 Posted July 20, 2001 Here is how we do it with a calculation field: If(DayofYear(Today) < DayofYear(dob), (Year(Today) - Year(dob)) - 1, Year(Today) - Year(dob)) Hope this helps. Garry
Newbies bugsbunnyy Posted July 25, 2001 Author Newbies Posted July 25, 2001 much obliged; works great; thanks
Recommended Posts
This topic is 8527 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