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.

Performing find by comparing to another field

Featured Replies

Hello,

I've run into a frustrating problem. I have a custom dialog box which appears in my script and the user inputs a certain year. What I want to do is then perform a find on a date field and just keep the records that have the same year as was inputted by the user.

I what to have the set the satisfies the calculation Year(dateField)=input

However, the find function does not seem to let me do this...

Thank you in advance.

Ryan

It's true that Filemaker does not do calculations during Find. However, you can simply enter a 4-digit year as the search criteria into a date field - Filemaker will interpret this as */*/yyyy (subject to date format being used) and find all records in the given year.

  • Author

I'm not quite sure how to do this in a script however. In the criteria I have tried both */*/<> and just <> but it comes up with an error stating that the field should be in the range 1 to 4000 and has to be in date format. I also tried doing this with a variable */*/$y but still to no avail. Is there any other way I could do this?

Try:

- Enter Find Mode

- Show Custom Dialog (for Input Field #1, select the date field)

- If Get ( LastMessageChoice ) = 1

- Perform find

else

- Browse mode

- End if

You have to verify that the user presses button #1 before proceeding. FileMaker treats buttons 2 and 3 as 'cancel' buttons and fails to set the field.

  • Author

Thanks that worked great, one more slight problem though, is that I need to perform the same search on two different tables so can I do this without have to the user re-enter the date using the method you outlined?

Perhaps you need to reconsider your strategy, because it will be difficult to show the results of searching two different tables at the same time.

  • Author

I'm aware of that, I don't intend to show the result of the find, I intend to sum a certain field in both tables and compare the two values...

Well, then you can grab the user-entered value into a variable, and use that for searching the other table, e.g.

Enter Find Mode [ ]

Show Custom Dialog [ FirstTable::Datefield ]

Set Variable [ $y ; FirstTable::Datefield ]

Perform Find [ ]

...

Go to Layout [ SecondTable ]

Enter Find Mode [ ]

Set Field [ SecondTable::Datefield; $y ]

Perform Find [ ]

  • Author

Thanks very much that works perfectly now.

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.