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.

using formulae in match fields

Featured Replies

  • Newbies

Hi,

I'm trying to set up a relationship between two files, where the match field of related records will be "less than" the match field in the master file. E.g. if the match field in the master record is a date, I'd like to find all related records that have values in the match field that are before that date. The FM5 help says that match fields can contain a calculation formula (the example they give is "Unit price < 100.00") so it seems possible to do this, but I cannot for the life of me work out what it is the help file means! Has someone successfully implemented such a relationship?

Thanks

Rob

You can't use a field from another file in the calculation of a match field. You can do this:

In your master file (left side of the relationship), create a field:

Constant (calculation, number, indexed) = 1

In your related file, create fields:

gDate (global, date)

Date (date, indexed)

Index (calculation, number) = Date < gDate

(an "If" is not necessary, this calculates to a logical "1" or "0")

In your master file relate Constant <--> Index (in the related file). You can set gDate using another relationship from your master file.

Your other option is to create a field "LessThanDate" (text) in your master file and fill it with every date before the date you a looking for. For example, if your date of interest is 3/11/2001, set "LessThanDate" to a list of dates separated by carriage returns:

3/10/2001

3/9/2001

3/8/2001

.

.

.

(earliest date of interest)

and relate "LessThanDate" to "Date" in your related file. The relationship will display any records with "Date" less than "LessThanDate". The fill operation can be done with a script or a plug-in.

-bd

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.