Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I want to show all records created between 2 specified dates.

Featured Replies

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 by Guest

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

  • 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

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

  • 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)

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.