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

Recommended Posts

Posted

Hi every one,

 

I need to calculate the number of years and months between two dates fields.

August31 = 8/31/2013

DOB = 9/1/2009

 

I need the calculation to show: 3Y 11M 

 

I appreciate any help.

Thanks

Posted

This calculation should do the trick:

 

 

Let([
     ElapsedYears=GetAsText(Year(SecondDate) - Year(FirstDate) - If(SecondDate <Date(Month(FirstDate); Day(FirstDate); Year(SecondDate)); 1; 0));
     ElapsedMonths = GetAsText(Mod(Month(SecondDate) - Month(FirstDate) + 12 - If(Day(SecondDate) < Day(FirstDate); 1; 0); 12))
];
If(FirstDate="";"";
ElapsedYears & " Y & " " & ElapsedMonths & " M")
)
 
I can't take credit for it; I found it in a custom function years ago.  Sorry I can't remember where, so I can't give proper credit.
Posted

Hi every one,

 

I need to calculate the number of years and months between two dates fields.

Also, look at the available Custom Functions at Brian Dunnings site here LINK and search for Elapse

Posted

It depends on what you're using it for and how you define a "month".

 

Doug's example is okay, but you may consider January 29th, 2013 to February 28th, 2013 a month, while that calc doesn't.

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