I have a fairly complicated SQL query with a nested subquery. When I try to use parameters in Microsoft Query is say I can use parameters in queries that cant be represented graphically. So I need another option. I think you can place your SQL query in a cell as a string then have a Macro run it. Any ideas how I could do this?
Thanks
-Jesse
Here’s what I do to work around the limitations of Microsoft Query in Excel 2007:
SELECT NULL AS Test, for example) in Microsoft Query and insert it into the worksheet.?‘ convention for parameters, then click OK.The idea is the bypass the GUI that MS Query provides, which has some arbitrary limitations that the underlying engine does not.
This works for many complex queries, but not all. When I encounter a query that MS Query refuses to digest at all, I either refactor the query (when feasible) or create a
VIEWon the SQL server and query against that.