picnichouse Posted August 31, 2005 Posted August 31, 2005 Hi, One of the most frustrating aspects of Filemaker for me is that you can't insert a variable or field in a "Perform Find" script step... i.e. you can't "Find by a date before Field1 and after Field2." I'd like to allow my users to enter a start date and end date in global fields and find records with a CreationDate field in that range when clicking on a button. What's the best way to do this? Thanks!
SlimJim Posted August 31, 2005 Posted August 31, 2005 Use a range find: insert startdate &"..."& end date into the CreationDate field.
RalphL Posted August 31, 2005 Posted August 31, 2005 Assuming Field 1 (gDate1) is after Field 2 (gDate2) Enter Find Mode Set Field [CreationDate, GetAsText (gDate2) & "..." & GetAsText (gDate1)] Perform Find
LaRetta Posted August 31, 2005 Posted August 31, 2005 Enter Find Mode [ ] Set Field [ CreationDate ; gStart & "..." & gEnd ] Perform Find [ ]
LaRetta Posted August 31, 2005 Posted August 31, 2005 And who says Forums doesn't rock in providing instant service? :bigshades:
SlimJim Posted August 31, 2005 Posted August 31, 2005 OK you slow-coaches Ralph and LaRetta - what were you waiting for.
LaRetta Posted August 31, 2005 Posted August 31, 2005 We were waiting for you to point the way, of course! BTW, I don't believe GetAsText() is required. And I use global date fields. In this way, FM will validate that the date is correct when Users type into the globals. Your finds will then more consistently produce the desired results. You may also want to test that both fields contain a date. You would change the script to: If [ gStart and gEnd ] Enter Find Mode [ ] Set Field [ CreationDate ; gStart & "..." & gEnd ] Perform Find [ ] Else Show Custom Dialog [ Message: "OK" ; "You didn't enter both dates. Try again." ] Exit Script End If
Recommended Posts
This topic is 7026 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now