Hi. I like to specify my criteria in set field steps as it is easier to see when reading the script what you are searching for - particularly when you are hard coding the find criteria. The following script will do what you are wanting - ie. find a set of children aged between 4-7 years who have either brown hair or blonde hair. Substitute your own field names.
Thanks Chris. Works perfectly.
Chris is right. please mark his answer as correct.
TIP: If I have many values like this, rather than New Record/Request (in Find), I may use Duplicate Record/Request and only change the values needed.
Is there any disadvantage to doing this as a Find (4...7) followed by a Constrain Found Set (using 2 requests for Hair Color)?
It is a couple more script steps, but I wonder if in certain multi-condition scenarios if it would be superior. For example, if we needed a third criteria boy/girl?
1 of 1 people found this helpful
No, either works. Just if I have multiple criteria (more that 2 fields?) I will use the first request and duplicate, changing just the field(s) that need changing.
enter find mode
set field ( gender ; "M" )
set field ( age; "1-10" )
set field ( state; "TX" )
set field ( state ; "NH" )
I can get TX or NH for 1-10 year old males, I only set (reset) the state field in the 2nd request as the other fields are duplicated from the first request.
I prefer scripted finds as they are easier to debug. But using Constrain, Extend and Modify Last are all good ways to make complex finds. I just add the Duplicate Record/Request to the toolbox.