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.

finding a date range

Featured Replies

Hi Folks,

I have a fairly simple database with one table. One of my fields is 'Date', which is represents the date on which I created the record. I'm trying to write a find script that finds a date range. The date range will almost always be the records between today and the past 7 days. How do I write this?

Thanks!

Hi EZ

Your script should be as follows:

enter find mode

setfield[date;Get(currentdate)-7 & "..." & Get(current date)]

perform find

The syntax may not be exact but it demonstrates how you set a date field to a range by using date1...date2

Hope that helps

Phil

  • Newbies

Hi Phil

I have virtually the same problem as EZ. I note that you are using Windows, I am using OSX on a mac, so the syntax is different. I had reached a similar conclusion to your response, which in mac is Set Field ["datefield", "Today-7 & "..." & Today"]. While this string is acceptable to scriptmaker, the problem seems to be that the datefield will not accept the input and just takes the Today-7 part; (presumably because it is set up as a date field- and even though I have already entered find mode).

I am lost for an answer, have you (or any other members) got any suggestions?

thanks

Duffledorf

The syntax has nothing to do with you os -- You're on FileMaker version 6, his suggestion was for fm 7+.

  • Newbies

Cheers John

That solved the problem. Thank you for your help.

Duff

BTW stay away from the Today() function and instead go with Status(CurrentDate)

  • Newbies

Hi John

I had used the today function, as it did seem easier, but on your advice have changed to the status(currentdate) which seems to provide the same result. Any reason for your recommendation?

Duff

  • Newbies

Thanks for the info and help.

Duff

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.