sql

G

Guest

I want to run a sql statement in Excel that will extract data from an Access
database. I have found this code but have a question. Value1, value2, etc.
are all part of an array. How would I modify this code to use the values in
the array? Depending on who is using it, the total number of items in the
array will change from person to person or from date to date. Thanks.......

Thanks....

SELECT column_name FROM table_name
WHERE column_name IN (value1,value2,..)
 
T

Tim Williams

SQL="SELECT column_name FROM table_name " & _
"WHERE column_name IN ('" & Join(arrCols,"','") & "')"

where arrCols is your array of column names.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top