Jump to content

Enter a date range in a find script


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

Recommended Posts

I am trying to find a range of dates automatically in a script. When I execute the script I get a question mark in the date, and a statement that no records match the request.

The script reads:

.

.

Enter Find Mode []

Set field ["date","Date(Month(Today),Day(Today-5),Year(Today))..Date(Month(Today),Day(Today),Year(Today))"]

Perform Find []

How do I go about scripting this to find the last five days?

Link to comment
Share on other sites

You were on the right track. The only problem is that you can't use Set Field when you have a date range. You have to use Insert Calculated Result instead. It's a Filemaker quirk. Use this:

Insert Calculated Result [date, DateToText(Status(CurrentDate)-5)&"..."&DateToText(Status(CurrentDate))]

Status(CurrentDate) is better than the Today function, because the Today function doesn't update if you leave Filemaker running past midnight, while Status(CurrentDate) is always correct.

Link to comment
Share on other sites

This topic is 8472 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.