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.

Next lowest within list

Featured Replies

Hi,

I may be in the wrong subforum for this ... but it's related to relationships, so we'll give it a shot.

If I have a list of people, and each of those people has one or more related records with a date field , any thoughts on the best way to find the next lowest date field compared to a given date.

Example, Bob has related records with the dates Jan 1, 2017, July 15, 2017, and Jan 31, 2018 -- I want to find the date that is the date thats' closest to, but before, Dec 1, 2017.  And, if Bob had not had any dates before Dec 1, 2017, I get effectively a null.

Thoughts on best way to do this?  Happy for it to be some sort of relationship, calculation, or custom function.  Would prefer any of those over a script.

Thanks!

Neil

 

 

I can think of two ways you could accomplish this:

  1. Use a custom function, perhaps similar to this one;
  2. Define a relationship to another occurrence of the events table as:
    People::PersonID = Events 2::PersonID
    AND
    People::GivenDate > Events 2::Date

    Sort the related records by date and get the latest one (either first or last, depending on the sort order).

--
P.S. Please update your profile to reflect your version and OS, so that we know what you can use (for example, using SortValues() and While() could make this task much simpler than the custom function mentioned above). 

 

Edited by comment

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.