473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Multiple Criteria

Hi everyone,

I'm a relative newbie to access so hopefully this will be easy for everyone.

I'm trying to limit the field in a query so that it does not include lines where their value is equal to 3, 5, 16,or 17.

I type

<>3
5
(separate lines)

and I've tried

<>3 Or 5

Both ways, the only variable that is taken away from the field is the 3. If I make the 5 right after the <>, then it is only the 5 that get taken away. What am I doing wrong and how can I fix this? Thanks!
Sep 26 '08 #1
7 1665
missinglinq
3,532 Expert 2GB
Place this in the Criteria box for your field in the Query Grid:

Not Like "[3,5,16,17]"

just like that, with quatation marks and brackets.

Welcome to Bytes!

Linq ;0)>
Sep 26 '08 #2
DonRayner
489 Expert 256MB
Hi everyone,

I'm a relative newbie to access so hopefully this will be easy for everyone.

I'm trying to limit the field in a query so that it does not include lines where their value is equal to 3, 5, 16,or 17.

I type

<>3
5
(separate lines)

and I've tried

<>3 Or 5

Both ways, the only variable that is taken away from the field is the 3. If I make the 5 right after the <>, then it is only the 5 that get taken away. What am I doing wrong and how can I fix this? Thanks!
not 3 and not 5 and not 16 and not 17

or you could do it like this

<>3 and <>5 and <>16 and <>17

You need to and the conditions togeather.
Sep 26 '08 #3
NeoPa
32,556 Expert Mod 16PB
Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!). This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

Administrator.

PS. Linq has provided exactly the correct method to use.
Sep 26 '08 #4
NeoPa
32,556 Expert Mod 16PB
Oops!

Reading it again I'm not so sure :S That is based on string only filtering and may well not (I don't think it does in truth) work in this situation.

Try instead "Not In(3,5,16,17)"
Sep 26 '08 #5
missinglinq
3,532 Expert 2GB
Reading it again I'm not so sure :S That is based on string only filtering and may well not (I don't think it does in truth) work in this situation.
Not sure what you mean, Ade!

Not Like "[3,5,16,17]"

works whether the field is Numeric (which I originally tested, based on the original post) and if the field is defined as Text, which I just now checked..

Linq ;0)>
Sep 26 '08 #6
NeoPa
32,556 Expert Mod 16PB
I tested it earlier and it didn't work for me. If you say it does I'll try it again then.
Sep 27 '08 #7
NeoPa
32,556 Expert Mod 16PB
I knocked up a quick table with numbers 1 - 15 in a field.

I knocked up a quick query with criteria = "Like '[1,7,13]'"

The results returned were :
1; 3; 7
Sep 27 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: TH | last post by:
I am (still :) working on a recipe database. Now I am trying to figure out how to set it up for an ingredient search. What I want it to be able to do is three things: 1. Search based on just...
4
by: ShyGuy | last post by:
I have a table with 4 fields. Three are used for criteria. I can get the DLookup to work with 1 criteria with the following but can't get it to work with 2 or three. NumofAppts = DLookup("",...
0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
4
by: carl.barrett | last post by:
Hi, I have a list box that displays 2 columns. Behind it sits a query with five columns. These are Column1 (DOB), column2 (a concatenated string of Surname Forname, Title), Column3 (Surname),...
6
by: NOSPAMrclark | last post by:
I'm wondering . . . . What is the generally accepted method for calling reports from multiple locations? Example: REPORT-A is called by selecting a record in a listbox and clicking a...
0
by: Greg Strong | last post by:
Hello All, In the past I've used a combo box with the 'row source' being an Access SQL union query to select "All" or 1 for only 1 criteria in a query. An example is as follows: SELECT 0 As...
7
by: Ceebaby via AccessMonster.com | last post by:
Hi All Here's hoping someone can help me with this. I have a report based on a query where the criteria for 4 of the fields is set from an unbound form. I want the user to be able to select any...
2
by: dlevene | last post by:
Hi - newbie here, be gentle. In Access 2003, I've created a report (based on a query) to produce mailing labels for all records where = "Community". is a combo-box field with the values coming from...
4
by: jvan2008 | last post by:
"Form1" combobox "cboModel" Row Source SELECT ., . FROM tblModel ORDER BY ; combobox "cboContactName" SELECT . FROM Query1 ORDER BY ;
3
by: kstevens | last post by:
Please help. I know the sysntax is wrong. Here are some details. I am looking for the sum of past shipped items. I originally wrote this Dsum with only one criteria, but because of multiple...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.