manually Test a find with just a year? (2013) or just a month? (1/2013) or a date range? I see no grammatical errors in your script.
This Google "search date range site:forums.filemaker.com" restricts results to these forums.
I looked at the sites you posted @DavidAnders. I've also tried multiple iterations of similar scripts with the same results. I can get find results from scripts that are for today only, or prior to today, or all...but any script I've tried with a range of +/- 7 or 30 days get the same error message as listed in my original post. Since I can run simple scripts successfully in the layouts I'm trying to make this work on...in the fields I'm interested in...and get the results I was seeking...I'm just not sure where to go next for these more complex find scripts.
As you stated...no grammatical errors. Scripting works with simple parameters. Very confused!
After entering Find mode I would suggest using SetField (by calculation) then perform find. I could be wrong but I see no reason to use InsertCalculatedResult.
I agree that set field is the better option but the error is due to getting the date range backwards. You have the latter date first and the earlier date last and that is tripping the error.
Get ( CurrentDate ) & "..." & Get ( CurrentDate) + 7 )
You also have some square brackets that shouldn't be there. You may have entered the date range in a repetition box instead of as the calculated result.
I used the set field option (thanks @Rick Whitelaw) and changed the date range (thanks @PhilModJunk) as suggested. I had to add a few more steps to my script to get it to all flow...but I'm getting results now. Thanks. I'm a NOOB...so I'm sure my scripts end up being very unwieldy...but as long as they get the job done, I'm OK for now.
I ended up with this:Go to Layout [ “Customer Details” (Customers) ]Show All RecordsEnter Find Mode [ ]Set Field [ Customers::Next Follow Up; Get ( CurrentDate ) & "..." & Get ( CurrentDate ) + 7 ]Perform Find [ ]Go to Layout [ “Contact Follow Up” (Customers) ]Sort Records by Field [ Ascending; Customers::Next Follow Up ]And thanks for everything...you're lifesavers.This works great at showing the records with a field value in "Next Follow Up" occurring in the next 7 days. If I change the 7 to 30 however, I end up with values less than the current date as well as the next 30 days. Any suggestions?I'm also trying to get last week and month (-7 & -30 days) into scripts. I can't seem to get them to bring back results...regardless of the side of the range I put them on in the calculation.
I'm sorry for all the questions...but if my find doesn't return any results, is there a way to add a script step to do something else? If...then? Thanks.
Thanks for all the help. With your suggestions, all of my scripts are up and running and returning the anticipated finds.
One final question...when my scripted find doesn't return any results, I get a dialog box stating "No records match this find criteria," with the options to cancel, continue, and modify find. Is there a way to automatically skip this dialog box and perform another scripted task?
Thank you @PhilModJunk. Everything is working the way I'd like it to right now. Who knows what hair I'll get as I work with my solution in the field.
That 'scripted finds' post you made was incredibly helpful for me. Thank you.