Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Simple Date compare Function?

Featured Replies

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!

Couldn't you just use something like

LowestDate = min(date1, date2, date3, etc)

or

LowestDate = min(Table:DateToCompare)

  • Author

HA!! I love it! A function that I have never explored!

GOD I love this forum!

Thanks!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.