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.

A script to search for records between two dates

Featured Replies

  • Newbies

Here is the situation:

I work in a school. We are trying to create a database to store our daily announcement list. Each record has a start date fiedl and an end date field. We would like to write a script that will select a group of records examining each record to see if the current date falls between the start date and end date values. Once it has selected the group of records, we want it to switch to a different layout and display the records.

Here is the one sticky point: The database will be hosted on a Filemaker Server, and the documentation we have found so far, says that in order for it to get the current date, the database must be closed and then re-opened each day AT THE SERVER. Obviously, this isn't going to work.

Anyone have any ideas?

BTW - We eventually will be using this database with Lasso and our webserver to accomplish a web version of this also.

Thanks for your help!

Pete

That current date stuff only applies if you've used the TODAY function in a file somewhere (calculated field, script etc).

Create a calculation field called say "status" in the database containing the records which you want to find which is ???-

Case(StartDate <= Status(CurrentDate) and EndDate >= Status(CurrentDate),1,0)

In the Storage options you will have to set this field as unstored, calculate only when required.

Your script performs a search on the status field being 1

ie

Enter find mode ( no pause, no restore find requests )

Set field ["Status", "1"]

perform find [replace found set] ( no restore find requests )

you could do it all with a single perform find step using rhe restore find requests but the method above saves commenting

  • Author
  • Newbies

Thanks Robert. Your info works perfectly and solves my problem.

Thanks again!

Pete

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.