UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Parametrize Interger List Of Where In Clause, Access 2016    
 
   
JanSal
post Jun 2 2020, 04:09 PM
Post#1



Posts: 2
Joined: 4-May 19



Hi there,
CODE
SELECT *
FROM TableA
WHERE Id IN (1,2,3)

I would like to parametrize the integer list of a WHERE id IN (1,2,3,...) clause in order to provide a sequence of numbers of undetermined length, i.e. WHERE id IN (@list). The result should look similar to this
CODE
SELECT *
FROM TableA
WHERE Id IN (@list)

"1,2,3" or "1","2","3" does not work. In case you know a work around, please drop me a line - thank you!
This post has been edited by JanSal: Jun 2 2020, 04:19 PM
Go to the top of the page
 
theDBguy
post Jun 2 2020, 04:27 PM
Post#2


UA Moderator
Posts: 78,506
Joined: 19-June 07
From: SunnySandyEggo


Hi. Welcome to UtterAccess!

welcome2UA.gif

Have a look at my article related to this topic. Hope it helps...

Create Parameter Query to Accept Multiple Values

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
JanSal
post Jun 2 2020, 05:04 PM
Post#3



Posts: 2
Joined: 4-May 19



[censored] of a welcome, theDBquy... quick and opportune. Thank you for sharing your solution!
Can I mark this question as solved?

Edit: Haha... H-E-L-L of a welcome got censored.
This post has been edited by JanSal: Jun 2 2020, 05:06 PM
Go to the top of the page
 
GroverParkGeorge
post Jun 2 2020, 06:15 PM
Post#4


UA Admin
Posts: 37,521
Joined: 20-June 02
From: Newcastle, WA


Yes, we discourage certain language here. This is a professional site for serious Access developers and users. Avoiding vulgarity, profanity and so on is a significant part of our culture.


--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
theDBguy
post Jun 2 2020, 08:01 PM
Post#5


UA Moderator
Posts: 78,506
Joined: 19-June 07
From: SunnySandyEggo


Hi. Glad we could assist. Good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    16th July 2020 - 07:37 AM