Connecting Tech Pros Worldwide Help | Site Map

SQL "in" statement anomaly

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:52 PM
Alvey Sidecast
Guest
 
Posts: n/a
Default SQL "in" statement anomaly

Well it is to me anyway.
------------------------------
Access Version = 2002
OS = XP Pro
User = Ordinary to bumbling
------------------------------

I was writing some sql yesterday which required the user to input a
variable number of values. So I wrote (much abbreviated);

"Where ColValue in ([Input values]);"

(The column ColValue is defined as numeric)

This worked fine when only one value, such as 98765, was entered in
the input box, but when I entered multiple values, such as 98765,12345
the query returned no values at all. I would have thought that if
Access was regarding the input strings as text then it would have
given the "different data types" message both times but this is not
happening. It gives results for a single value but no results for
multiple values.

Why is this so?

And more importantly, is there an alternative? (And ideally, one that
doesn't involve changing the column type to alpha. Or using VBA.)


tia

alvey


btw. I haven't used Access much this century (since A97), but what
have MS done to Help? The keyword search in Index doesn't find 'In',
'Exists' and a few other old favourites. Am I missing something here?

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.