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

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

Recommended Posts

Posted

I want to perform a find script based on a date field. The date range would be greather than or equal to today's date and less than or equral to today's date plus 30 days.

I have been using the "specify" function in the perform constrain found set script, but do not know the proper syntax. All I can do is find records greater than or equal to today using >=//.

Can anyone help out with the other part of the equation, the less than or equal to today plus 30 days part?

thanks in advance

dta

Posted (edited)

Enter Find Mode() //Uncheck Pause

set field(Datefield); Get(CurrentDate)-30 &"..."&get(Currentdate)

Perform Find()

hth

In rereading your question I see you want to look at 2 different sets of data. First in the range of the last 30 days and then anything greater than or equal to today. Is it that you want to see both sets of data in the same view?

Edited by Guest
Posted

The date range would be greather than or equal to today's date and less than or equral to today's date plus 30 days.

I read it to mean:

Get ( CurrentDate ) & ".." & Get ( CurrentDate ) + 30

Posted

Thanks all.

Yes I am looking for a script which queries out data in a date range between today and 30 days from today, based on a date field in the database.

LaRetta, I attempted to use the syntax you provided in the constrain found set "specify find requests" using the script maker, by adding it in the criteria window however the system gave me an error message “the field is defined to contain a valid date in the range of years 1 to 4000 and should look like “12/23/2007”. You must enter a valid date.”

Posted

Still does not work.

I am using the script associated with a button. Under button set up, the system accepted the syntax under optional script parameter. Odd, looked like it was working, but as a test I changed the 30 to 45 and did not get the correct data.

Posted

You need to set up a script not a script parameter. Your button refers to that script and the steps should be:

Enter Find Mode() //Uncheck Pause

set field(Datefield); Get(CurrentDate)&"..."&get(Currentdate)+30

Perform Find()

Posted

I believe it should be "..." not".."

Nope, aldipalo. Both are valid to FileMaker.

Dta, the issue is simply that it was specified that you use Set Field[] instead. You cannot use a Find Request with a calculation.

Posted

I'm sorry, I'm not understanding you. Are you saying the poster method is correct? What calculation. I tested my script and it worked perfectly.

Please explain.

Al

Posted

What you listed is fine and identical to mine except for the "..". I am saying one should use Set Field[] and cannot try putting the calculation within a Find Request.

The calculation is simply: Get ( CurrentDate ) & ".." & Get ( CurrentDate ) + 30

The only thing I said to you, Al, was that ".." is legal range as well as "...". :wink2:

Posted

Thank you both.

Working just fine!

Didn't quite realize the required sequence of commands to perform a find.

Regards

dta

Posted

You see LaRetta, that's why I love this Forum, I'm always learning something new. I thought you'd simply made a typo. I never knew the".." was legal in a range.

:yay:

Posted

...that's why I love this Forum, I'm always learning something new.

Indeed! And it is the small surprises that can tickle me the most!

As for using "..", it is important to note that it will NOT work is searching for a decimal range such as: greater than .14 but less than .99. The search sets as: .14...99 and FileMaker doesn't know if it is ... range ending value at 99 or .. range and ending value at .99. It assumes 99. I don't consider it a break; after all, how would FM know? But I use ".." because two of the greatest Developers use it. If I'm going to imitate, I imitate the best every chance I get!

I particularly like it because it's a bit strange. :mickey:

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