How many OR conditions can be in a query?

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?
0
Utf
7/17/2007 8:58:01 PM
access.queries 6343 articles. 1 followers. Follow

4 Replies
577 Views

Similar Articles

[PageSpeed] 36

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


"KimPotter" <KimPotter@discussions.microsoft.com> wrote in message 
news:94905619-D13A-4B2B-84ED-8D5338CC8D37@microsoft.com...
>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? 


0
Jeff
7/17/2007 9:05:35 PM
On Tue, 17 Jul 2007 13:58:01 -0700, KimPotter wrote:

> 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.

-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
fredg
7/17/2007 9:58:31 PM
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.
-- 
KARL DEWEY
Build a little - Test a little


"KimPotter" wrote:

> 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?
0
Utf
7/17/2007 10:48:01 PM
Nice!

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

Gotta remember that one!!

Regards

Jeff Boyce

"KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message 
news:0A99AE03-AA5D-46E2-A10B-3732D1ED97D8@microsoft.com...
> 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.
> -- 
> KARL DEWEY
> Build a little - Test a little
>
>
> "KimPotter" wrote:
>
>> 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? 


0
Jeff
7/17/2007 11:36:28 PM
Reply:

Similar Artilces:

More than 3 conditional formatting conditions?
I'm using Excel 2000, and I need to program a row of cells to tur certain colours based on 5 possible words being input in a given cell. So, basically: If V is in C1, I want that entire row to turn red If W is in C1, I want that entire row to turn blue, and so on for five (or six) different possibilities. Everything I've read says that every pre-2007 version of Excel onl allows three such conditions. Am I out of luck, or is there some wa around that -- ooda ----------------------------------------------------------------------- oodam's Profile: http://www.excelforum.com/member....

MSFlexGrig and SQL Query
How can i load dates in a MSFlexGrid Object whit a SQL Query???? ...

Can you move a page from one publication to another?
Is there a way to pick up a page from another publisher document and move it into the one you are currently creating? Select all, copy, and paste. -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question http://support.microsoft.com/KB/555375 "Melis" <Melis@discussions.microsoft.com> wrote in message news:AE2DE89E-E052-4A56-9E62-79C8528450D4@microsoft.com... > Is there a way to pick up a page from another publisher document and move > it > into the one you are currently creating? ...

How can I have an initial zero in an Excel cell?
I want to be able to enter times as eg 0845 but no matter what cell format I use, there is a problem, either that the initial zero is lopped off or that I am informed there is an error. Is there any way of solving this? try <format><cell><number><custom> enter 0000 and you will get a four digit display with an initial display with a leading zero. Note this is not a time function "ALupin" wrote: > I want to be able to enter times as eg 0845 but no matter what cell format I > use, there is a problem, either that the initial zero is lopped off or...

How can I shrink a flyer to print two to a page?
I am using Microsoft Publisher and I can't seem to get it to print two whole flyers on one page. I tried using the two page spread option in the view tab- but this just gets a portion of the center twice? How can I get the publisher to do this? CS Flower wrote: > I am using Microsoft Publisher and I can't seem to get it to print > two whole flyers on one page. I tried using the two page spread > option in the view tab- but this just gets a portion of the center > twice? How can I get the publisher to do this? ===================================== What if y...

Can't open database window using shift key...
Hi there, I have an Access database that I distribute to my client on CDROM. The start up options of the database are set so that the database window is not visible to the users. When the database is updgraded the database manager copies it from the CDROM to the relavant PC and then uses the shift key on opening in order to display the database window and link to the tables in the existing back-end. This procedure has been done many many times without a problem... BUT last week he found that holding down the shift key whilst opening the database no longer opened the database window and leave...

Parameter Query using date ranges
I am creating a parameter query where I want to pull data between 2 dates. In the date criteria of my query, if I write between #01/01/2008# and #01/31/2008# +1, I will get all data for January. If I use a form to enter the dates and have Between [Forms]![autoexec]![start] And [Forms]![autoexec]![end] +1 in the date criteria, I get an error. Does anyone know what I should put in the criteria to make the query work? Are you entering your dates as m/d/y? What happens if you try: DateAdd("d", 1, [Forms]![autoexec]![end]) Is the form open? -- Duane Hookom Microsoft Access...

Conditional Format #4
Hi, I've got some conditional formatting in some columns but not others. When I enter data in a row moving from one column to the next and I get to a column with no CF, Excel copies accros the CF from the previous column. Is this a 'Helpful' idea by Excel and if so can I turn it off? If it's not does anyone know how I can fix the columns with no conidtion to stay with the original formatting? Thanks Ian Try this: <Tools> <Options> <Edit> tab, And *UNCHECK* "Extend list formats and formulas". -- HTH, RD ===============================...

Can't see printers in directory
Hello, The shared and network printers aren't showing up in the directories of the workstations. On XP machines, the network printer does show, but no shared printers. On Windows 7, no printers show. I need to get this resolved. Thanks for any help and God Bless, Mark A. Sam Hello Mark, Which directories are you talking about? How did you add the printers to the machines? Please describe some more details. Best regards Meinolf Weber Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights. ** Please do NOT email, ...

&quot;New Web Query&quot; function
good day, are there any friends use New Web Query fuction under Data -> impor external data? My objective is to export (a list of stocks info) from web page t Excel spread sheet. e.g. the is is Microsoft's stock details (stock code: MSFT) http://finance.yahoo.com/q/ae?s=MSFT i can use "New Web Query" function to link this page to spread sheet. Question: how can I define a list of stocks (let say 10 differen stocks) that I want to monitor apart from creating 10 differen separate spreadsheets link with each individual stock code? any ideas are welcome thanks for your help ...

Please Help...I can not send/receive or delete email on outlook 2000
It gives an the following errors" Error has been detected in the file C:|Windoews\Outlook.pst. quit all mail applications and then use Inbox Repair tool." I spent hours tring to find a solution on the support section. Couldn't find it.. Thank you so much for help.. What size is yr *.pst? OL prior to 2003 can have problems when greater than 1.7gb The inbox repair tool is scanpst.exe If oversize; http://support.microsoft.com/?kbid=296088 David "Daniel" <dqiab@yahoo.com> wrote in message news:05a401c3676d$0ef74c50$a401280a@phx.gbl... > It gives an the follow...

amend a PO with a query? Please help!
Hello, Our new warehouse manager entered, received and committed a PO from the wrong vendor - over 100 items! Does anyone know a way to either reverse the PO or change the vendor? Please help!!!! Thank you! diana Diana, You can reverse the PO by opening it again in receiving mode. Use the Quick Scan button and add an item to the PO (any item). This will 'unlock' or re-open the PO. You can now delete the item you just added back off. Next you would enter the quantity 'Received to Date' of each item into the 'Quantity Received' column as a negative. Fo...

Can you still run Clip Gallery in Publisher 2003?
I just recently upgraded from Publisher 2000 to 2003, and now I can't figure out how to use Clip Gallery. I gave up & copied my clip gallery files to my hard drive, and ran Clip Organizer, but none of the keywords "stuck", so I can't search for clips using keywords anymore. I'm not real keen on searching thru thousands of thumbnails for an appropriate clip, so for now I'm finding my clips in Home Publisher, then copying and pasting into my Publisher 2003 documents. Publisher 2003 help makes a reference to still being able to run Clip Gallery, but gives no i...

Can't upgrade HQ to 2.00
I try to upgrade HQ database from 1.3 reresh to 2.00 but I have Error "An error occurred while attempting ti upgrade the database 'DF_Configuration_SoftwareValidation1' is not a constraint " How should I do? Help me plz. >_<" -- TOY2TOY ...

How many days of database backups should I keep?
How many days worth of database backups should I keep before deleting? 1 week, 1 month, 1 year? They are large and take up lots of space, but I don't want to delete any if I might need them. I don't see any purpose of keeping multiples of your database backup, unless you have been doing it with a purpose, because each of your backups contain the same data, except the newer backups contain more. For example, if your computer dies or whatnot, you wouldn't want to restore an old database, you would want to restore your newest backup so you lose less data. Did you have a reas...

Believe it...You can be rich with only $910 investment !!!
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <P>Hi,</P> <P>If anyone interested to find out what can $910 do for you, please go to below URL to view the online presenation.</P> <P><A href="http://thegloballink.biz/ui2u.html">http://thegloballink.biz/ui2u.html</A></P> <P>You won't regret if you view the presentation.</P> <P>Thanks</P> <P>Elvin Loh</P> <P><A href...

Can't Import old files
I have a system crash and had to re-install XP. My Outlook express files are on a other drive. I had that because of other experience. That worked verry good. But now i want to import my old emails and i can't get them!! I can't acces the files. I have already looked into the help in different sites but no sollution yet. I cant copy,rename, the files. I tried to get them back with DBxpress (recover program) but also that program can't open the files. It look like that the files are protected with a NO write/read function. I can deleted the files but thats not a option till i ha...

How can I use Outlook in two computers (my PC and my laptop)? I o.
How can I use Outlook in two computers (my PC and my laptop)? I can only see my incoming emails in my PC, but not in my laptop; even though I have configured Outlook in both computersto received the incoming emails to my university account. "osiris" <osiris@discussions.microsoft.com> wrote in message news:9C5ACFC5-3859-4FB0-BC20-3AC7A9B5F6A3@microsoft.com... > How can I use Outlook in two computers (my PC and my laptop)? I can only > see > my incoming emails in my PC, but not in my laptop; even though I have > configured Outlook in both computersto received th...

Using SQL Query to mass update a field.
Having a problem in eOrder where the pictures are not showing up. I found out the Inventory image in internet information is mapped to a drive letter. If I remove the drive letter, I can see the picture in eOrder. I would like to mass update the SY01200 INET4 field and change all from f:\inventory pictures\image.jpg to image.jpg (where image.jpg is the file name). It sounds like I need to create a cursor script but am not sure how to do this. Can anyone help me with this? Thanks. Backup you data first. You might be able to use DTS to trim the data with a string transformation. Or you ...

Even after switching to newView . previousView can be seen
I am working on an SDI application. It has 3 views(With corresponding buttons to open them).When i switched from 2nd to 3rd view...I can see the 2nd view between the gaps of controls on 3rd view.I think the 2nd view is not completely erased. Pls suggest me What to do..its urgent Thanks Are you remembering to hide the 2nd view when you show the 3rd view? Perhaps even destroying the 2nd view when you create the third view? How are you displaying the views? Peter "vani" <vanisri@yahoo.com> wrote in message news:088401c38eb3$a61d63e0$a101280a@phx.gbl... > I...

Can't access my contacts from outlook after migration
I recently bought a new HP laptop (preloaded). Loaded my MS Office, installed all components, then copied my PST files across and configured Outlook to use them. Now I can se my contacts if I click on contacts tab, but not use them from inside compose a mail in outlook. What's up !! "LynneJ" <LynneJ@discussions.microsoft.com> wrote in message news:1C11574C-1F7B-48CE-B5C6-AD16F3E41FF3@microsoft.com... > I recently bought a new HP laptop (preloaded). Loaded my MS Office, > installed > all components, then copied my PST files across and configured Out...

How can I update multiple cells from a UDF?
How can I get a UDF to change the contents of several cells other than the one from which it was called? Can I use named cells or must I use A1 addressing? Prof Wonmug - > How can I get a UDF to change the contents of several cells other than the > one from which it was called? < You can't. A UDF entered into a worksheet cell or cells can only return a value to that cell or those cells. - Mike http://www.MikeMiddleton.com "Prof Wonmug" <wonmug@e.mcc> wrote in message news:v805m510gm5b4e52oefvce4mes88r5bqnu@4ax.com... How can I get...

Database query from same worksheet
I know how to create a database query from another worksheet. But can the query be from the SAME worksheet? How is that done? If you want to 'query' data on the same worksheet, I would use Auto or advanced filter -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "Hall" <hall@garp.org> wrote in message news:%23Fx89OEQFHA.3496@TK2MSFTNGP09.phx.gbl... >I know how to create a database query from another worksheet. > > But can the query be from the SAME worksheet? How is that done? > > But that&...

Can't find the field 'frm_Test2" referred in your expression.
Hi, This question was asked many times and answered too. But none of them rectify my issue. Plz help me. In my parent form I have two sub forms. In Button click event of Main Form I am accessing the Sub Form Control value. But it doesn't work. Debug.Print Forms!frm_MainForm.Controls!frm_Test2!VS_Type.Value Where frm_MainForm is the Parent form, frm_Test2 is sub form and VS_Type is control of the sub form. It is very urgent. How about this for a try: Forms!frm_MainForm!frm_Test2!form.VS_Type hth -- Maurice Ausum "bsm" wrote: > Hi, > > This question was asked...

Problem with Code Because I already have an Open Query
Hi, I have already open a Query named ACCOUNTS and I want to copy the already filtered results into a Table name ACCOUNTS CHARGED. The code is stuck on the Set Myset=CurrentDb("ACCOUNTS") What do I have to adjust to make it work? Thanks Private Sub ACCOUNTS_CHARGE_Click() Dim PoseidonHotelProgram As Database Dim rsta As DAO.Recordset Dim frm As Form Dim Msg, Style, Title, Response, MyString Set Myset = CurrentDb("ACCOUNTS") Set Myset2 = db1.OpenRecordset("ACCOUNTS CHARGED") With Myset If Not .EOF Then .MoveFirst End If Do While ...