and/or limits?

  • Thread starter Thread starter Guest
  • Start date Start date
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.)
 
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]
 
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top