You need to run a loop for each value like so
Main Topics
Browse All TopicsHi Folks,
I need help writing a SQL query in ASP. I have an array with "," (comma) separated values.
I want my query to give me the link values from the table D_MainDemo when the demoName matches the values in the array.
Any help is appreciated.
Thanks
RG
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
well i can not run your code without all the rest of it. You are obviously having a problem with what you are trying to feed into the split command dynamically. Try replacing your dynamic with the code below
I am sure that will work, if it does try to do some response.write with your vDemoName variable and post what it spits out so we can get to the bottom of what is going on.
Where you able to get it fixed? If not I would suggest moving your Response.Write up to before the split command and print out vdemoarray so we know exactly what is being fed into your split. Once we get the vdemoarry set correctly the code I wrote will work. There must be some character messing up the string or something. Let me know what comes out.
Business Accounts
Answer for Membership
by: sybePosted on 2009-10-07 at 08:24:12ID: 25516539
> I have an array with "," (comma) separated values.
My thoughts are that either you have an arry of values, or you have a comma-separated string with values.
Anyway, you could use something like
SELECT * FROM <tablename> WHERE <column> IN ('value1', 'value2')
To construct that in ASP from an array with string-values it would be something like this:
sSQL = "SELECT * FROM <tablename> WHERE <column> IN ('" & Join(yourArray, "','") & "')"