Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6864 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello

I have a calculation which determines the age of a person.

it is

Year(Get(CurrentDate)) - Year(dateofbirth)

This however returns 56 years. The original dateofbirth entry was

05/29/1950

I wouldlike to find a way or a formula to determine the exact number of days this person has been alive and I need help with this.

Thanks very very much

Dave

Posted

This topic comes up all of the time. If you did a search for Age, Birthday Calculation, etc. you should see a bunch of treads on this.

Here is a calculation:

GetAsNumber(Year(Get(CurrentDate)) -

Year(dateofbirth) - Case(Get(CurrentDate) <

Date(Month(dateofbirth); Day(dateofbirth); Year(Get(CurrentDate))); 1; 0)) & " Years, "

&

GetAsNumber(Mod(Month(Get(CurrentDate)) -

Month(dateofbirth) + 12 - Case(Day(Get(CurrentDate)) <

Day(dateofbirth); 1; 0); 12)) & " Months, "

&

GetAsNumber(Day(Get(CurrentDate)) -

Day(dateofbirth) + Case(Day(Get(CurrentDate)) >=

Day(dateofbirth); 0; Day(Get(CurrentDate) -

Day(Get(CurrentDate))) <

Day(dateofbirth); Day(dateofbirth); Day(Get(CurrentDate) -

Day(Get(CurrentDate))))) & " Days"

HTH

Lee

Posted

Try:

GetAsNumber ( Get ( CurrentDate )) - GetAsNumber ( DateOfBirth )

Posted

Hi, hartmut!

Get(CurrentDate)-dateofbirth must be your wish. You tried it?

If you want to get how many years and how many days, this can be did by other formula.

Posted

And I'll add to it. The issue is dropping one year if the current year's birthday hasn't happened yet. Since you just want number of years, try:

Let (

thisBday = Date ( Month ( dateofbirth ) ; Day ( dateofbirth ) ; Year ( Get (CurrentDate) ) ) ;

Year ( Get ( CurrentDate) ) - Year ( dateofbirth ) - ( thisBday > Get ( CurrentDate ) )

)

Corrected less than to greater than ... :blush2: Freudian slip. And I should mention this is result of number and needs to be UNSTORED. The GetAsNumber is not required because FM adds dates just fine - they ARE numbers. I believe you threw Kent off because you contradicted yourself - first wanting years but then saying exact number of DAYS. If so, a number result with: Get ( CurrentDate ) - dateofbirth will give you their total days.

This topic is 6864 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.