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 6757 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Hi,

Can you please help with a calculation that will subtract the visit date - date of birth.

The results shall be provided to the user in years, months, weeks, and days. I have attached a small file for testing.

thank you so much who ever you are....

Date_Calc.zip

Edited by Guest
Posted

This question comes up from time to time. Do a search for [color:blue]+Birthday +Calculation as the [color:blue]Keywords, with or without my name as the username, and you will find many calculations that will provide the bases of what you are needing.

Here is one of the most recent threads Link that should get you going. Just replace the [color:red]Get (CurrentDate) with your [color:red]visit field.

HTH

Lee

Posted

Hi,

Thanks for the resource but i tried copying your code into my db into the fied age_years and no luck.

I tried your code but substituted your currentdate field with my vis_date field and when i click ok i get a pop up message saying "This parameter is an ivalid get function". This is the code i used.

GetAsNumber(Year(Get(vis_Date)) -

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

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

Would you know why it is not working?

Posted

Year( vis_date ) - Year( dateofbirth ) - ( vis_date < Date ( Month ( dateofbirth ) ; Day ( dateofbirth ); Year ( vis_date ) ) ) & " Years, "

result text.

BTW: this covers only the first part of your question :) how many years ?

Posted (edited)

Hi Maria,

Compare this to what you were trying to put in the calculation

GetAsNumber(Year(vis_Date)) -

Year(Dob) - Case(vis_Date) <

Date(Month(Dob); Day(Dob); Year(vis_Date))); 1; 0)) & " Years, "

&

GetAsNumber(Mod(Month(vis_Date)) -

Month(Dob) + 12 - Case(Day(vis_Date)) <

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

&

GetAsNumber(Day(vis_Date)) -

Day(Dob) + Case(Day(vis_Date)) >=

Day(Dob); 0; Day(vis_Date) -

Day(vis_Date))) <

Day(Dob); Day(Dob); Day(vis_Date) -

Day(vis_Date))))) & " Days"

HTH

Lee

Edited by Guest
Posted (edited)

Maria,

I added a field with Lee's calc. Just change visit date and it will change the year month and day.

Hope this helps you get an idea how it works.

Dean

Edited by Guest

This topic is 6757 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.