我对sql server和excel / microsoft查询相对较新,
我有这样的查询
Select ...[data]...B1.b,B2.b,B3.b From TABLEA
Inner join (
SELECT ---[data]...sum(...) as b From TABLEB
WHERE Date between [startdate] and [enddate]
) as B1
Inner join (
SELECT ---[data]...sum(...) as b From TABLEB
WHERE Date between [startdate-1week] and [enddate]
) as B2
Inner join (
SELECT ---[data]...sum(...) as b From TABLEB
WHERE Date between [startdate-2weeks] and [enddate]
) as B3
Where Date between [startdate] and [enddate]
当我手动引入日期时它有效,但我需要它们是“动态”(从excel引入)但是,当我把“?” (对于所有日期的参数),它会抛出错误。
“无效的参数编号”
:D我怎样才能在excel中完成这项工作?
我正在使用SQL Server和Microsoft Query Connection Data。