I've got a query which I want to depend on certain parameters from an excel sheet, but I get the error 'parameters are not allowed in queries that can't be displayed graphically'. The only way to get around it that I see is to use a view, but how much extra overhead would that give? It would mean joining two tables (one with near 70000 and one with over 200000 records and both having around 40 fields) into that view, probably using only 5 or so of the total 80 fields. We do not have a test server. Alternatively, is there a way to change the following query to one for which microsoft query does allow parameters?
select count(distinct a) from table1 where b=0 and c < '2010-01-01' and a in
(select a from table2 where d between '2010-01-01' and '2010-12-31')
or as a join:
select count(di开发者_Go百科stinct table1.a) from table1 inner join table2 on (table1.a=table2.a
and table2.d between '2010-01-01' and '2010-12-31') where table1.c < '2010-01-01'
and table1.b=0
I want to replace the dates (for c and d) with cellvalues.
Thanks,
Ernst
Have you considering migrate the data from Excel to SQL-Server tables and then execute the query?. The most of the DBMS have tools for data migration.
精彩评论