Jump to content

Find with multiple criteria...


This topic is 7569 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm close on this...but can't seem to get it to work exactly right.

I need to script a search based on two criteria. The first is whether or not a date falls into a specific range. Once I learned about using the "Insert Calculated Result", that part was easy. The second criteria is more problematic. There is a data element that can have one of three values. I need to be able to search for any combination of the three values. I have created globals for the start and stop dates, and a yes/no global for each of the three possible values.

I've been able to make this work using a calculation, but because of the size of the database (2K records and growing about 2-300/month), running the calculation takes a long time. Finds work much faster.

Any hints?

confused.gif

Link to comment
Share on other sites

Hi:

So, are the fields you are searching on the globals? If so, it won't work. If they are not globals, will the field you are trying to search on have any combination of yes and no? So you could have

No No No

Yes No No

Yes Yes No

and so on...

If it can be any combination, then you could just search for these fields not being empty. If you are searching for a specific combination, you will have to specify that.

Please give more information on what you are searching for, and I will try and help

Ken

Link to comment
Share on other sites

If your combinations are specific and not just 'any' combination, then I would agree with Ken's assertion. Just create a new find request and insert "=" into the fields, and then Omit Record.

If the combinations are specific, then duplicate your original request as many times as necessary, and set the fields in each request to each possible combination of values.

Link to comment
Share on other sites

I don't see why you are using "Yes, No." Unless null, no answer, matters; which it doesn't sound like it does. Because that is more complicated. So, if they can choose 1 or more of 3 possible values, you can use a standard checkbox field for the choices, using a value list of the 3 choices.

A checkbox field produces a multi-line text field. You can do a scripted Find on more than one value at a time by separating them with paragraph returns. So you put in the find criteria you want, and omit the one you don't want (it will only be one).

Since you got the Date range, I'll ignore that for now. I figure 8 Finds, incl. one for all empty.

I did a little example file with Colors (black, green, red):

Find two colors (black and green):

Enter Find Mode []

Set Field [

CheckboxFind.zip

Link to comment
Share on other sites

This topic is 7569 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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