473,386 Members | 1,647 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,386 software developers and data experts.

How to Use the In Operator in Query?

124 100+
I have a query in which I parameterized a column (CodeCommitteeId). Because more than one committee can be selected I'm using the In operator. So, in the criteria line of the CodeCommitteeId column I have the following:

Expand|Select|Wrap|Line Numbers
  1. In ([Forms]![f_ParamCommittees]![txtCommitteeList])
  2.  
However, when I run the query if I enter 1,2 as the parameter value, I get no results. But if I enter only one number I get results. Why is the In not working?
Feb 25 '11 #1

✓ answered by Rabbit

You can't pass "1,2" into a parameter and expect it to work. In expects parameters but that only passes a string. You can't pass an array of parameters that way. You will need to build the SQL in code.

3 3700
TheSmileyCoder
2,322 Expert Mod 2GB
Have you tried replacing the , with a ;? The regional settings get me constantly....
Feb 25 '11 #2
bullfrog83
124 100+
Yeah, but that doesn't work. I get errors.
Feb 27 '11 #3
Rabbit
12,516 Expert Mod 8TB
You can't pass "1,2" into a parameter and expect it to work. In expects parameters but that only passes a string. You can't pass an array of parameters that way. You will need to build the SQL in code.
Feb 28 '11 #4

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

Similar topics

0
by: alexz | last post by:
valuA = (request.form("toadd")) If valuA = "" then SQL = "UPDATE CourseReg SET attended='Active' WHERE ID IN("&request.form("toadd")&")" Set RS = MyConn.Execute(SQL) End If MyConn.Close Set...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
2
by: Newbie | last post by:
Hi, Could someone please tell how MINUS operator works for comparing and giving non-matching records in Table1? Does MINUS operator compares all records of Table1 with all records of Table2 to...
5
by: MGFoster | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've converted an ACC97 .mdb file to an ACC2K2 .adp. A report that worked in ACC97 doesn't work in ACC2K2. Report setup: ACC97 ...
2
by: StaZ | last post by:
Hello, I would simply like to know if there's a way to disable the "feature" of MS Access that rewrites your queries "correctly"... This feature makes this : ...WHERE SomeBooleanField...;...
2
by: dskillingstad | last post by:
I'm trying to set up a parameter query based on an unbound form. This search form has about 5 text boxes where the user can type in values within each box and search a specific table based on the...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
5
by: Samik2003 | last post by:
Hello, The problem is my query is not extracting the correct xml data from the database : Is there something which I am missing?? ANy help would be appriciated. Thanks, Sam. THis is the...
2
by: apollock | last post by:
Our application is having an issue where a query in a stored procedure periodically gets a bad plan with a Lazy Spool Operator that changes the query execution time from 5ms to 900ms and kills our...
2
by: troy_lee | last post by:
I am passing a value from a combo box on a report initiation form to a query which is the record source for the report. My question is how do I pass the combo box value with an operator. I want...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.