turnknuckle
11-06-2002, 05:45 PM
Greetings
Is it possible to get user input and use that value for a table name in a SQL query?
ie.
If strFirmType = "Stock Finance" Then
table1 = "stock_finance"
...
and then
...
strSQL2 = "SELECT * FROM table1 WHERE table1.ind_pref = 'All sectors considered - particularly Bio-Technology and Retail'"
If so what is the correct syntax - Do I need to wrap the variable - 'table1' or [table1] or something
I reckon Im using the wrong syntax...?
Thanks
Turnknuckle
Is it possible to get user input and use that value for a table name in a SQL query?
ie.
If strFirmType = "Stock Finance" Then
table1 = "stock_finance"
...
and then
...
strSQL2 = "SELECT * FROM table1 WHERE table1.ind_pref = 'All sectors considered - particularly Bio-Technology and Retail'"
If so what is the correct syntax - Do I need to wrap the variable - 'table1' or [table1] or something
I reckon Im using the wrong syntax...?
Thanks
Turnknuckle