我尝试在Report
中设置SSRS 2012
,设置完毕,所有代码都在SSMS
中正常运行。但在SSRS
我得到以下内容:
按查看报告
出现以下内容
如您所见,ToDate参数字段再次要求输入值。 以下是参数的代码:
财政参数
SELECT
FiscalPeriodId
,FiscalPeriodName + ' - ' + [Status] + ' ' + Convert(varchar(15),ENDDate, 101) AS FiscalPeriodName
,FiscalPeriodId AS OrderId
FROM fin.FiscalPeriod
WHERE Status = 'Closed'
AND GeneralLedgerGroupId = @Location
UNION
SELECT
FiscalPeriodId
,'Current'
,9999999 AS OrderId
FROM fin.FiscalPeriod
WHERE Status IS NULL
AND GeneralLedgerGroupId = @Location
UNION
SELECT
0 AS FiscalPeriodId
,'AS of Specified Date' AS FiscalPeriodName
,10000000 AS OrderId
ORDER by OrderId DESC
日期参数
SELECT
CASE
WHEN fp.ENDDate IS NULL
THEN GETDATE()
ELSE fp.ENDDate
END AS ToDate
FROM fin.FiscalPeriod fp
WHERE FiscalPeriodID = @FP
UNION
SELECT
CASE
WHEN @FP IS NULL
THEN GETDATE()
ELSE NULL
END AS ToDate
ORDER BY ToDate DESC
我在网上搜索过,发现Stackoverflow
上有一个问题似乎是同一个问题,但没有答案(2012)
。有什么建议吗?