Multiple Operators within a Query Criteria

lledar

Research Analyst
Local time
Today, 14:28
Joined
Mar 8, 2005
Messages
10
Below is what I posted a few days ago. Let me see if I can ask it any differently. I basically need to know if it is possible in a query to have 2 operators so that you can pull a value "=" and a value "between".

Can you make both a "=" and "Between" value set for one category? ie.

[Patent]=[Forms]![WDCRPD]![Patent1] And [Forms]![WDCRPD]![Patent2] And [Forms]![WDCRPD]![Patent3] And [Forms]![WDCRPD]![Patent4] Or [Forms]![WDCRPD]![Patent1] Is Null Or [Forms]![WDCRPD]![Patent2] Is Null Or [Forms]![WDCRPD]![Patent3] Is Null Or [Forms]![WDCRPD]![Patent4] Is Null

[Patent] Between [Forms]![WDCRPD]![PatRangeLow] And [Forms]![WDCRPD]![PatRangeHigh] Or [Forms]![WDCRPD]![PatRangeLow] Is Null Or [Forms]![WDCRPD]![PatRangeHigh] Is Null

I would like to return both exact values and/or a range of values. Is it possible?
 
Let me oversimplify:

WHERE [MyValue] = 53 OR [MyValue] = 73 OR [MyValue] Between 4 AND 25

or this:

WHERE [ThisValue] = 23 OR ([ThatValue] = 45 AND [ThisValue] Between 2 AND 10)

This last one would return all records where ThisValue equals 23 as well as records in which ThatValue equals 45 where ThisValue is equal to 2,3,4,5,6,7,8,9,10

You just can't say:

WHERE [ThisValue] = 53 AND 73 AND 28 ...

You must specify the field you are basing it against and use parenthesis to group them logically.
 

Users who are viewing this thread

Back
Top Bottom