Passing array as parameter to Access query
Is it possible to pass an array as a parameter to an SQL query to retrieve data from an Access database?
I'll be building an array in Excel that contains one to many values. These values will be used as arguments to select records from the database which will then be imported to Excel. Example. A field in a customer (Access) table is 'zip' code, which is part of the customer's address. I want to select all of the customers who are in the list of zip codes that are passed as an array parameter. If only one zip code, then I want all customers in that zip code. If more than one zip code, then I want all customers in all those zip codes.
Thanks.
Re: Passing array as parameter to Access query
If you put the list of zip codes in an access table it would be simple to do.
Code:
Select * from customers where ZipCode In (Select zipcode from ZipCodesList)
To do this within Excel I have no idea as I never use Excel for this type of stuff.
Re: Passing array as parameter to Access query