Pass parameter to SQL query from excel data connector
Posted: Wed Apr 06, 2016 10:37 pm
Hi, I have a scenario where I need to run the same SQL query with different values. I made the dynamic value in the query as parameter and pass value to that parameter using excel data connector. Below is the same query that i have used. This query is not working when I enter "weekID" values in the excel sheet and run.
Dim weekID as Int32
select * from table1 where col1 = " & weekID & "
Parameter value is not passing to the query if I use excel data connector. But if I pass value to the variable "weekID" in the code it self, then is is working. Below query is working
Dim weekID as Int32 = 201613
select * from table1 where col1 = " & weekID & "
Please let me know how can i pass weekID parameter to the query using excel data connector. I am using odbc data connector for executing the query.
Thanks
Vivke
Dim weekID as Int32
select * from table1 where col1 = " & weekID & "
Parameter value is not passing to the query if I use excel data connector. But if I pass value to the variable "weekID" in the code it self, then is is working. Below query is working
Dim weekID as Int32 = 201613
select * from table1 where col1 = " & weekID & "
Please let me know how can i pass weekID parameter to the query using excel data connector. I am using odbc data connector for executing the query.
Thanks
Vivke