Skip 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.

Scripting a "Find by Date Range"

Featured Replies

Hi,

One of the most frustrating aspects of Filemaker for me is that you can't insert a variable or field in a "Perform Find" script step... i.e. you can't

"Find by a date before Field1 and after Field2."

I'd like to allow my users to enter a start date and end date in global fields and find records with a CreationDate field in that range when clicking on a button. What's the best way to do this?

Thanks!

Use a range find: insert startdate &"..."& end date into the CreationDate field.

Assuming Field 1 (gDate1) is after Field 2 (gDate2)

Enter Find Mode

Set Field [CreationDate, GetAsText (gDate2) & "..." & GetAsText (gDate1)]

Perform Find

Enter Find Mode [ ]

Set Field [ CreationDate ; gStart & "..." & gEnd ]

Perform Find [ ]

And who says Forums doesn't rock in providing instant service?!!! :bigshades:

OK you slow-coaches Ralph and LaRetta - what were you waiting for.

We were waiting for you to point the way, of course!

BTW, I don't believe GetAsText() is required. And I use global date fields. In this way, FM will validate that the date is correct when Users type into the globals. Your finds will then more consistently produce the desired results.

You may also want to test that both fields contain a date. You would change the script to:

If [ gStart and gEnd ]

Enter Find Mode [ ]

Set Field [ CreationDate ; gStart & "..." & gEnd ]

Perform Find [ ]

Else

Show Custom Dialog [ Message: "OK" ; "You didn't enter both dates. Try again." ]

Exit Script

End If

Somebody had to be first!

  • Author

jeez

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

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.