How many OR conditions can be in a query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know you can only have up to 9 OR conditions in a query if you use the
grid, but if you type the OR conditions all on the criteria line, how many
can you have?
 
Kim

There are functions you might use instead of multiple OR's -- for example,
in the selection criterion "cell", you might use:

In('Red','Green','Yellow','Blue','Puce')

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I know you can only have up to 9 OR conditions in a query if you use the
grid, but if you type the OR conditions all on the criteria line, how many
can you have?

Why do you say you can only have 9 "Or" conditions?

You can add more rows to the grid.
For instance, to add 3 additional rows....
Highlight the last 3 rows and select Insert + Rows.
 
You can have an unlimited amount by listing the criteria in a table and using
it without joining in your query. Use the field name in brackets in the
criteria row of the query design view grid.

You can also add a Yes/No field in the criteria table is you will use the
list many times and need to edit it. Just add the Yes/No field to the field
row of the query design view grid and a -1 (minus one) as criteria. Checking
a Yes in the criteria table says to use that record.
 
Nice!

I've used Cartesian Product queries before, but never to provide selection
criteria.

Gotta remember that one!!

Regards

Jeff Boyce
 

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

Back
Top