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

Recommended Posts

Posted

FM accepts the following calculation but it's not doing what I require it to. I'm trying to conditionally format a date field if the current date minus 3 years is >= TOP 006 Records 3::Most Recent Date.

 

What's glaringly wrong, the first part of my calculation between Day, Month etc won't accept ; hence &, but the second part does?

 

Day (Get (CurrentDate)) & Month (Get (CurrentDate)) & Date(Year( Get (CurrentDate) - 3) >= Day ( TOP 006 Records 3::Most Recent Date ); Month (TOP 006 Records 3::Most Recent Date );Year (TOP 006 Records 3::Most Recent Date ))

 

 

 

Posted

Try =

Date ( Month ( Get(CurrentDate) ) ; Day ( Get (CurrentDate) ) ; Year( Get(CurrentDate) ) - 3 ) ≥ TOP 006 Records 3::Most Recent Date

or =

Let (
today = Get (CurrentDate)
;
Date ( Month ( today ) ; Day ( today ) ; Year ( today ) - 3 ) ≥ TOP 006 Records 3::Most Recent Date
)
Posted

Thanks comment. So I erroneously thought TOP 006 Records 3::Most Recent Date needed breaking down into Day, Month and Year.

 

Also TOP 006 Records 3::Most Recent Date is formatted dd/mm/yyyy. Do I have to reverse the Month and Day in your calculation?

Posted

So I erroneously thought TOP 006 Records 3::Most Recent Date needed breaking down into Day, Month and Year.

 

That's right: it's already a date and doesn't need to anything to be done to it. Get (CurrentDate) is also a date - but in order to subtract 3 years from it, you need to:

1. Break it up to individual elements;

2. Subtract 3 from the Year element;

3. Recombine the elements into a date.

It was step #3 that was the major issue in your attempt; you tried to concatenate them as text, instead of plugging them into the Date() function which was written specifically for this purpose.

 

 

Do I have to reverse the Month and Day in your calculation?

No. The order of parameters of the Date() function is universal.

  • Like 1
Posted

That's right: it's already a date and doesn't need to anything to be done to it. Get (CurrentDate) is also a date - but in order to subtract 3 years from it, you need to:

1. Break it up to individual elements;

2. Subtract 3 from the Year element;

3. Recombine the elements into a date.

It was step #3 that was the major issue in your attempt; you tried to concatenate them as text, instead of plugging them into the Date() function which was written specifically for this purpose.

 

 

No. The order of parameters of the Date() function is universal.

 

Thank you very much for your explanation.

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