Jump to content
Server Maintenance This Week. ×

Simple Date compare Function?


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

Recommended Posts

Hello,

I'm converting to FM7 from FM6. I have a script that is run to determine the oldest of a set of dates. This is later used to sort a found set. The script I wrote a LONG time ago, before I knew what a case() function was for is this:

If ["IsEmpty(EX FUD) = 1"]

Set Field ["gl_DateCompare", "Elmer FUD"]

Else

Set Field ["gl_DateCompare", "EX FUD"]

End If

If ["IsEmpty(EQ FUD)"]

Else

If ["EQ FUD <= gl_DateCompare"]

Set Field ["gl_DateCompare", "EQ FUD"]

End If

End If

If ["IsEmpty(TU FUD)"]

Else

If ["TU FUD <= gl_DateCompare"]

Set Field ["gl_DateCompare", "TU FUD"]

End If

End If

If ["IsEmpty(FS FUD)"]

Else

If ["FS FUD <= gl_DateCompare"]

Set Field ["gl_DateCompare", "FS FUD"]

End If

End If

If ["IsEmpty(FS FUD 2)"]

Else

If ["FS FUD 2 <= gl_DateCompare"]

Set Field ["gl_DateCompare", "FS FUD 2"]

End If

End If

I want to make this into a simple Custom Function.

I know I can a series of Case() Steps, however, I want to learn how to make this cleaner, and faster.

Any ideas?

There are 5 dates to compare, I want to find the lowest of the 5 dates.

Thanks!

Link to comment
Share on other sites

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