October 16, 200520 yr Does anyone have a good calcualtion or solution for determining a persons age by comparing currentDate with a field containing the persons date of birth. Seems like a simple solution that I can't seem to make work.
October 16, 200520 yr How do you want the age displayed, Papabjoe? Year number only, year number with "years old", Year and Days? How will it need to be formatted?
October 17, 200520 yr You could create a calculation field with a calculation like this: Year(Get(CurrentDate)) - Year(dateofbirth) - (Get(CurrentDate) < Date(Month(dateofbirth); Day(dateofbirth); Year(Get(CurrentDate)))) I found the above calc a long time ago somewhere on this forum. Since then it has worked fine for me.
October 19, 200520 yr I think this one should work better: Case(Day(Get(CurrentDate)) =Day(dateofbirth) and Month(Get(CurrentDate)) ≥ Month(dateofbirth);Year(Get(CurrentDate)) - Year(dateofbirth);Year(Get(CurrentDate)) - Year(dateofbirth) - (Get(CurrentDate) < Date(Month(dateofbirth); Day(dateofbirth); Year(Get(CurrentDate)))))
October 19, 200520 yr Both produce the same results. It just depends how convoluted of a calculation you want to use. Note that the second half of your calculation is all that is necessary since (Get(CurrentDate) < Date( Month(dob); Day(dob); Year(Get(CurrentDate)) )) will return 0 when the current date is greater than or equal to the birthdate for the current year, so nothing will be subtracted.
October 20, 200520 yr Author These are all great, I've already inserted one and it's working just great. I always seem to get stuck in one particular line of thought until I hit a brick wall. Usually these posts remind me of something I forgot and then suddenly it all becomes clear. Thanks for your help.
Create an account or sign in to comment