Dear all,
I have an unresolved problem:
- Currently I have an Excel file (Sheet 1), which has a column called CIFNO (this sheet including many lines - more than tens of thousands of lines).
- Data needs to be retrieved in SQL Server, that table (DDMAST) also has a CIFNO column.
Currently I retrieve the data from SQL Server by making a connection to SQL Server from Excel, in the Connection Property setting the following statement (command text) like this:
Select * from "BRANCHDATA". "Dbo". "DDMAST" where CIFNO in (123,456,789)
However, the worst thing about this is that the parameter in the above statement is now "static" and as such, to get enough data, I have to copy all CIFNO in Sheet1 again and past it in to command text (it is very complex because Sheet 1 has more than tens of thousands of lines).
So is there a way to put the value of CIFNO column in Sheet 1 into the reference of the other statement, or can you write VBA function to handle this?
Please tell me if you have solutions for this,
Sincerely thank.
I have an unresolved problem:
- Currently I have an Excel file (Sheet 1), which has a column called CIFNO (this sheet including many lines - more than tens of thousands of lines).
- Data needs to be retrieved in SQL Server, that table (DDMAST) also has a CIFNO column.
Currently I retrieve the data from SQL Server by making a connection to SQL Server from Excel, in the Connection Property setting the following statement (command text) like this:
Select * from "BRANCHDATA". "Dbo". "DDMAST" where CIFNO in (123,456,789)
However, the worst thing about this is that the parameter in the above statement is now "static" and as such, to get enough data, I have to copy all CIFNO in Sheet1 again and past it in to command text (it is very complex because Sheet 1 has more than tens of thousands of lines).
So is there a way to put the value of CIFNO column in Sheet 1 into the reference of the other statement, or can you write VBA function to handle this?
Please tell me if you have solutions for this,
Sincerely thank.