By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,576 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

SQL "in" statement anomaly

P: n/a
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?
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.