and/or limits?

6

'69 Camaro

Hi, Jeff.
Is there a limit to how many and/or criteria you can have in a query?

Yes. One may have up to 40 AND's in a WHERE or HAVING clause in Access
2000. One may have up to 99 AND's in a WHERE or HAVING clause in Access
2003. I'll let someone else verify these limits for the other versions.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
J

John Vinson

Is there a limit to how many and/or criteria you can have in a query?

Yes - actually a couple of them. I believe that you can have up to 32
clauses; and you may run into "Query Too Complex" if the compiled
query is too large.

Take a look at the In() operator - rather than

ID = 31 OR ID = 38 OR ID = 84 OR ID = 91

you can say

ID IN(31, 38, 84, 91)

You may also want to (for efficiency as well as to avoid these limits)
consider creating a table of criteria and joining it to the table that
you want to search.

John W. Vinson[MVP]
 
J

Jeff C

Thank You

John Vinson said:
Yes - actually a couple of them. I believe that you can have up to 32
clauses; and you may run into "Query Too Complex" if the compiled
query is too large.

Take a look at the In() operator - rather than

ID = 31 OR ID = 38 OR ID = 84 OR ID = 91

you can say

ID IN(31, 38, 84, 91)

You may also want to (for efficiency as well as to avoid these limits)
consider creating a table of criteria and joining it to the table that
you want to search.

John W. Vinson[MVP]
 
Top