Hi all,
I am trying to retrieve data from a SQL connection in an excel workbook. Using MS query and the parameters options I am able to parse a single item number and have the query bring back that relevant information from the database.
I would like it to bring back the information for multiple item numbers in one go, however, I cannot get that to happen.
I've tried pulling all of the numbers into the format that would work in a normal IN statement for example:
Ref
1234
4567
7890
is presented as ('1234',4568','7890') and pointed the parameter cell reference to that, but keep getting '[Microsoft][ODBC SQL Server Driver]String data, right Truncate' error.
Is there a VBA method that can take the multiple rows of item numbers and amend the query to look them up?
Thanks in advance
Rob
I am trying to retrieve data from a SQL connection in an excel workbook. Using MS query and the parameters options I am able to parse a single item number and have the query bring back that relevant information from the database.
I would like it to bring back the information for multiple item numbers in one go, however, I cannot get that to happen.
I've tried pulling all of the numbers into the format that would work in a normal IN statement for example:
Ref
1234
4567
7890
is presented as ('1234',4568','7890') and pointed the parameter cell reference to that, but keep getting '[Microsoft][ODBC SQL Server Driver]String data, right Truncate' error.
Is there a VBA method that can take the multiple rows of item numbers and amend the query to look them up?
Thanks in advance
Rob