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.

Date Calc: Find nearest date in future

Featured Replies

Hi there

I´m pretty new to filemaker and I´m searching for a date function that will display the nearest date compared to the current system date ?

I have a few date fields (date 1 ... date 50). Now the calculation date field should show me which of the date fields is coming up first and closest to the current date ?

Is there a function for that?

Thanks a lot,

fraank

I have a few date fields (date 1 ... date 50).

Do you mean a record has 50 date fields? That doesn't sound like a good method for anything, let alone your current question.

  • Author

Yes, that is what I meant. 1 Record that has max. 50 date fields to compare. There might be about 20 records later on.

As I said, that's not a good method in general. I am not sure what this is about, but usually you would have 50 (or rather any number of) related records in another table. For example, a table of Projects and a table of Milestones, related by ProjectID. Then you can get the upcoming milestone by defining another relationship as:

Projects::ProjectID = Milestones 2::ProjectID

AND

Projects::cToday < Milestones 2::Date

where cToday is an unstored calculation = Get(Currentdate). By sorting the related milestones by Date, ascending, the first related record will be the upcoming milestone.

Create an account or sign in to comment

Important Information

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

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.