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.

perform find = a range from // todays date

Featured Replies

as a script step, i would like to find records in my database which range 2 days less than through two days greater than todays date

i can get records where x field has todays date by

perfrom find = data::x =//

but cannot figure out the script formula for a range of days off of the current date...such as

data::x =<2...//...>2

it must be simple, but i am stumped.

thanks for any help you can give

arfus nyc

Edited by Guest

Enter Find Mode [  ] 

Set Field [ Untitled::aDate; Get ( CurrentDate )-2 & "..." & Get ( CurrentDate )+2 ] 

Perform Find [  ] 

--sd

here's simple script

enter find mode []

set field (date, Get(currentdate)-2 & "..." & Get(currentdate)+2)

perform find.

HTH

echo echo

--sd

  • Author

thank you for your help.

in that you all are in a concensus, clearly i am missing something here.

i am creating the script with scriptmaker and do not understand the script step:

Set Field [untitled::aDate; Get (Current Date) -2 & "..." Get (Current Date) + 2]

The field that i am performing the search in (for example) is "departure info" which is already a calculated value with a date return from fieldname "departure date"

Beyond my confusion of how the set field fucntion works, I think that 'current date' may be confusing.

I am requesting records where the date in 'departure info' field equals from plus to minus 2 days from todays date.

does that make sense?

me confused much?

... Ok, Get(CurrentDate) is a filemaker function that gets the current date... i.e todays date, therefore Get(CurrentDate) today would evaluate to 22/02/06 ... Get(CurrentDate) - 2 would evaluate to 22/02/06 - 2 days = 20/02/06

Therefore the total equation: Get(CurrentDate) - 2 & "..." Get(CurrentDate) + 2 would today evaluate to:

20/02/06...24/02/06

Now, thats the data that gets entered into the field..

The set field script step, simply sets any field you specify within the current table (or a table related to the current table) to whatever you specify in your calculation... which in this case would be the calculation Get(CurrentDate)-2 & "..." Get(CurrentDate) + 2

Finally, the filemaker find ... engine... can do range searches. A range search is delimited by 3 periods in between your lower value and your higher value, and filemaker will return to you all records that fit into your criteria... so in a normal find situation if you just entered 20/02/2006...24/02/2006 into a date field, all records that have a date between or including those two dates, would be returned to you...

Finally, summing up all the script does is enters find mode, sets the field Untitled::aDate = the result of the calculation Get(CurrentDate) - 2 & "..." & Get(CurrentDate) + 2 and then performs a find, thereby returning to you your original request of all records between those two specific dates...

as always, i hope this helped and lessened your confusion

~genx

Instead of specifying the field Untitled::aDate in your database, especially seeing as it in most likely hood doesnt exist, just specify your field, "departure info" or "departure date" or whatever the field you want to search in happens to be...

Remember, you are doing all of this in script maker, and then executing a script to find your records, you are not using a calculation field (though you could).. anyway, yeh... good luck

~genx

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.