I am new to filemaker and need to write some code to find entries within a certain date range (ie from today + 7 days) to place each entry into a report. Can anyone give me a place to start?
The three dots need to be between the dates. Enter this into the date field while in Find Mode.
That being said - if you want to script a Find for a date range there is a way to do it.
First determine where your start date will come from. If you are using the current date that's fine then Status(CurrentDate) will give you that.
Then determine how, or where, you will get your end date.
If I was going to script a find based on your example
"from today + 7 days"
Here is how the script would look:
Enter Find Mode []
Insert Calculated Result [Select,"Date","DateToText(Status(CurrentDate)) & "..." & DateToText(Status(CurrentDate) + 7)"]
Perform Find []
For this example I used a date field name of Date.
Couple of notes here:
-- With "Enter Find Mode" and "Perform Find" you do not want to restore any previous search criteria. Also, do not use the Pause when entering Find mode.
-- If you do not convert the date to text then it enters the julian date and the script returns an error.
Hope this helps.
If you have any follow up questions, post them here.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.