Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6498 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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
Posted

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

Posted

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

Posted

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

  • Newbies
Posted

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

This topic is 6498 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.