Dezza12 Posted February 18, 2004 Posted February 18, 2004 I'm creating a tickler database of tasks, and I'm having trouble writing a script that will perform a date range find. Basically, I want to push a button in my Contacts db that will then open the tickler database and show me the tasks that are due within the next seven days. I can't figure out how to script the find for the current date, plus seven days? Make sense? Sorry if this is cake. Dezza
-Queue- Posted February 18, 2004 Posted February 18, 2004 Enter Find Mode [ ] Insert Calculated Result [datefield, DateToText(Status(CurrentDate)) & "..." & DateToText(Status(CurrentDate) + 7)] Perform Find [ ] If [not Status(CurrentFoundCount)] Enter Find Mode [ ] Show Message ["No tasks are due within the next week."] Show All Records End If
Vaughan Posted February 18, 2004 Posted February 18, 2004 Do you want to find all tasks that have a due date within the next seven days, or only those tasks that are due but not yet completed? If the latter you'll need a "Completed" field as well as a "DueDate" field. For the script below, the Completed field is empty if it's not completed. Enter Find Mode [] Insert Calculated Result [DueDate, DateToText (Status(CurrentDate)) & "..." & DateToText (Status(CurrentDate) + 7)] Set Field [Completed, "="] Perform Find [replace current found set] Notes: the DueDate field must be on the current layout when the script is run. Also, the option "restore find requests" must not be selected for either the Enter Find Mode or Perform Find steps.
Dezza12 Posted February 18, 2004 Author Posted February 18, 2004 Thanks for the responses, but I must be doing something wrong. I enterd the script, as you've written, but FileMaker tells me there are no valid criteria in the request. What could I be messing up?
-Queue- Posted February 18, 2004 Posted February 18, 2004 The date field must be on the current layout when the script occurs.
Dezza12 Posted February 18, 2004 Author Posted February 18, 2004 It is. I have only three layouts, and the the date field is on each one. I began the script by going to a new layout (which the date field was on), but when it didnt work, I deleted the layout and went back to the main page. Same problem. Dezza
-Queue- Posted February 18, 2004 Posted February 18, 2004 Are you using the Status(CurrentDate) function explicitly as stated? You must include DateToText( ) as well, or it will fail.
-Queue- Posted February 19, 2004 Posted February 19, 2004 Can you attach a clone of the file? This makes no sense to me. I'd like to see it for myself.
Dezza12 Posted February 19, 2004 Author Posted February 19, 2004 Attached here. Thanks for your help. The scipt is "Find Date Range" Dezza
Ugo DI LUCA Posted February 19, 2004 Posted February 19, 2004 While you investigate with Queue about this classic Find approach, here's another using relationships. g_DateRange c_ShowDateDue = Case(IsEmpty(Completed), Date, "") Then the script. SetField[g_DateRange, DateToText(Status(CurrentDate)+1)&"
-Queue- Posted February 19, 2004 Posted February 19, 2004 There is no attachment. You'll need to zip or stuffit first, btw.
kenneth2k1 Posted February 19, 2004 Posted February 19, 2004 Yep. Sure enough looks like you did not uncheck "Restore find requests" in the Perform Find step.
-Queue- Posted February 19, 2004 Posted February 19, 2004 Remove the 'Restore find requests' check on Perform Find as Vaughan instructed earlier.
Recommended Posts
This topic is 7583 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