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

Recommended Posts

Posted

Hello Team,

I need to compare two dates and determine which is the "newer" date. For example, I have a field called "ExitDate". I need to compare whatever the date is in ExitDate, which may be June 19, 2009, and compare it with todays date and determine which is "newer" and place the result in a field.

I can't see how to create what must be an "if/then" statement of some sort.

Let me know what you think.

- Sez

Posted

Assuming ExitDate is a date field:

Case ( Get (CurrentDate) > ExitDate ; "Expired" ; "Not yet" )

Or:

Choose (

1 + Sign ( Get (CurrentDate) - ExitDate ) ;

"Future" ; "Today" ; "Past"

)

Posted

Hello Team,

First, thanks for such a quick reply! This really SMA!

I used the following;

GetAsDate(Min(ExitDate; Get(CurrentDate)))

In a calculation field substituting Min for Max and its a perfect solution. Thank you.

If I understand this correctly it is saying;

"Return a date - the "earliest" of the following two dates - exitdate and todays date."

This way, if there is a date in the exit date field that is earlier than todays date, it leaves it alone. Which is exactly what I'm looking for. Again, thank you.

I think the other code posted here is interesting as well, and can see other applications for the concept. I will take note of it.

- Sez

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