I'd like to put a SQL query in an Excel 2010
spreadsheet where one of the columns in the SELECT will be a parameter.
I've played around with it for a bit with different table aliases and changing the command text from within the connection properties box with no success. It just gives me various errors with each attempt. I tried googling but found nothing on the subject. I suspect that it is simply impossible to do this using a standard database query as MS query is quite limiting. Can someone verify that it is indeed impossible to have a SQL query in Excel with a column name in the SELECT
as a parameter? If it is not impossible could you share how to get it to work?
It'd be something like...
SELECT tble.Date, tble.Hour, tble.[parameter]
FROM my_table tble
I'd want some parameterized wheres once I got the above to work.