July 31, 200619 yr Search/Find between 2 dates. I have a field 'created' [Date], where the date is automatically entered when the record is created. I have made 2 more fields 'gStartdate' and 'gEnddate' [both Date]. But my script below, does not produce the expected result (all records between the two dates entered) Allow User Abort [Off] Set Error Capture [On] Show Custom Dialog ["Search between two Dates"; "Use the Format dd/mm/yyyy i.e. 25/09/2006"; Link::gStartDate; Link::gEndDate] Enter Find Mode [] Set Field [Link::Created; Link::gStartDate & "..." & Link::gEndDate] Perform Find/Replace [No dialog; Find Next] Thanks in advance John (very much a Novice) Edited July 31, 200619 yr by Guest
July 31, 200619 yr It looks pretty much as it should, except last line where you have chosen to use this: http://www.filemaker.com/help/Script-Steps36.html ...which doesn't make sence in your case, you should have picked this one instead: http://www.filemaker.com/help/Script-Steps71.html --sd
July 31, 200619 yr Author I have changed the script, but, no success. Allow User Abort [Off] Set Error Capture [On] [color:blue]Show All Records Show Custom Dialog ["Search between two Dates"; "Use the Format dd/mm/yyyy i.e. 25/09/2006"; Link::gStartDate; Link::gEndDate] Enter Find Mode [] Set Field [Link::Created; Link::gStartDate & "..." & Link::gEndDate] [color:blue]Perform Find [Restore] It does not seem to make any difference what I enter for the query dates, i.e. 01/012006...01/06/2006 I still get the same results, i.e. "Found 1013" whish includes the following... 01/09/1990 01/09/1990 01/09/1990 12/09/2005 12/09/2005 12/09/2005 John
July 31, 200619 yr Remove the Restore inside the [ ] in last line. Because you Show All Records count as a restoreable request. It has no meaning in you script to use Show All Records, the command is only required if you need to be sure all records is selected before say a looping script. --sd
July 31, 200619 yr Author AARRRRRGGGHHH! Soren When I double checked, I found that I had not set the 2 Fields as Globals, even though I would have bet money that I had. All working now. Thanks for your help and my apologies for wasting your time. John (definitely a novice)
July 31, 200619 yr I found that I had not set the 2 Fields as Globals It can be done recursively though, it's a shame the dialog requires real fields! If [ IsEmpty ( Get ( ScriptParameter ) ) ] Show Custom Dialog [ Message: "Search between two Dates"; "Use the Format dd/mm/yyyy i.e. 25/09/2006"; Buttons: “OK”; Input #1: theDateSearch::theLower, "Start Date"; Input #2: theDateSearch::theUpper, "End Date" ] Perform Script [ “DateRangeSearch”; Parameter: theDateSearch::theLower & "..." & theDateSearch::theUpper ] Else Set Field [ theDateSearch::theLower; "" ] Set Field [ theDateSearch::theUpper; "" ] Enter Find Mode [ ] Set Error Capture [ On ] Set Field [ theDateSearch::StoredDate; Get ( ScriptParameter ) ] Perform Find [ ] Set Error Capture [ Off ] End If --sd
Create an account or sign in to comment