Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help writing a find date function for a report

Status
Not open for further replies.

Chellie

Technical User
Sep 8, 2003
1
AU
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 coding for searching on a date range is

StartDate...EndDate

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.



Im Steven B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top