Munchie Posted February 4, 2005 Posted February 4, 2005 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!
Echo33029 Posted February 4, 2005 Posted February 4, 2005 Couldn't you just use something like LowestDate = min(date1, date2, date3, etc) or LowestDate = min(Table:DateToCompare)
Munchie Posted February 6, 2005 Author Posted February 6, 2005 HA!! I love it! A function that I have never explored! GOD I love this forum! Thanks!
Recommended Posts
This topic is 7299 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 accountSign in
Already have an account? Sign in here.
Sign In Now