Newbies rbyron Posted March 7, 2010 Newbies Posted March 7, 2010 I am trying to write a script that will find records within a range. After reviewing other posts, I have tried several approaches, none of which work. At the moment, I am doing the following: Records in my To Do database all have a Due Date. I have created global storage date fields gStart and gEnd. Unsuccessful scripts include: Enter Find Mode[] Set Field[To Do::Due Date = To Do::gStart & "..." & To Do::gEnd] Perform Find[] This script returns error message "No Records Satisfy Criteria" even though I know that many records fall within the specified range. I note that many posts on this subject use a ";" rather than an "=" in the Set Field line above, but the Set Field "Specify" dialog box will not allow anything other than an "operator" between Due Date and gStart...gEnd. I have also tried the Insert Calculated Result approach along the same lines: Go to Layout [Due Date Report] Enter Find Mode[] Insert Calculated Result [select;To Do::Due Date=To Do::gStart & "..." & To Do::gEnd] Perform Find [] Whenever I use the above approach, I receive an error message "The value in this field must be a valid date etc." But the Due Date field, as well as the gStart and gEnd fields are all date fields formatted to show dates as "12/23/2005" This is my first foray into scripting, so be gentle . . .
bcooney Posted March 8, 2010 Posted March 8, 2010 Welcome to the forum. I think that your first attempt is very close. The post you reference is probably written, and not a true representation of the script. The obvious question...you've entered dates into gStart and gEnd, and they do have their storage options set to global. Many people think that starting the field name with a "g" is enough. Many people forget to click the global storage option. That out of the way, Set Field is definitely the way to go. There is no "=" sign in the script step. Set Field asks for two things: the field to set (that is your Due Date) and the value to set it to (in your case the calculation which looks fine (To Do::gStart & ".." & To Do::gEnd).
Newbies rbyron Posted March 8, 2010 Author Newbies Posted March 8, 2010 Thanks! It worked! I was entering the entire calculation [Due Date = gStart ... gEnd} in "Specify" Calculated Result, rather than separately using "Specify Target Field" [Due Date] and Specify Calculated Result [gStart...gEnd].
Recommended Posts
This topic is 5725 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