标题: Microsoft 报表设计器
------------------------------
检索查询中的参数时出错。
SqlCommand.DeriveParameters 失败,因为 SqlCommand.CommandText 属性值是无效的多部分名称 "if @p_mw = 'M'
begin
select a.*,b.* from ZPPM_Header a left join ZPPM_Items b on a.AUFNR = b.AUFNR where auart in ('ZP11', 'ZP1J') and vtext <> '' and vtext = @p_project and CONVERT(varchar(6),gstrp,112) = @p_month
end
else
select a.*,b.* from ZPPM_Header a left join ZPPM_Items b on a.AUFNR = b.AUFNR where auart in ('ZP11', 'ZP1J') and vtext <> '' and vtext = @p_project and case when DATEDIFF(d,DATEADD(d,9-datepart(dw,DATEADD(yy,DATEDIFF(yy,0,gstrp),0)),DATEADD(yy, DATEDIFF(yy,0,gstrp),0)),gstrp)<0 then cast(year(DATEADD(yy, DATEDIFF(yy,0,gstrp)-1,0)) as nvarchar(4))+right(cast(100+datediff(d,DATEADD(d,9-datepart(dw,DATEADD(yy, DATEDIFF(yy,0,gstrp)-1,0)),DATEADD(yy, DATEDIFF(yy,0,gstrp)-1,0)),DATEADD(dd,-1,DATEADD(yy, DATEDIFF(yy,0,gstrp),0)))/7+1 as nvarchar(3)),2) else cast(year(DATEADD(yy, DATEDIFF(yy,0,gstrp),0)) as nvarchar(4))+right(cast(100+datediff(d,DATEADD(d,9-datepart(dw,DATEADD(yy, DATEDIFF(yy,0,gstrp), 0)),DATEADD(yy, DATEDIFF(yy,0,gstrp),0)),gstrp)/7+1 as nvarchar(3)),2) = @p_week",当前对“4”的限制不够。