我正在尝试让SSRS显示发布日期的财政年度
作为一个例子
显示01/04/2018的日期。财政年度专栏将于2018年返回 显示31/03/2018的日期。财政年度专栏将于2017年返回
SELECT
IIF(Month(rTranslog.IssueDate)<=3, Year(rTranslog.IssueDate)-1,
Year(rTranslog.IssueDate)) AS [FY}
,rTranslog.IssueDate
,rTranslog.Site
,rTranslog.NSVCode
,rProduct.LabelDescription
,rTranslog.Ward
,SUM(rTranslog.Qty) AS Quantity
,SUM(rTranslog.Cost)/100 AS CostGBP
FROM
rTranslog
INNER JOIN rProduct
ON rTranslog.NSVCode = rProduct.NSVCode
GROUP BY
rTranslog.IssueDate
,rTranslog.Site
,rTranslog.NSVCode
,rProduct.LabelDescription
,rTranslog.Ward
有什么想法吗?
答案 0 :(得分:0)
您可以使用SSRS中的表达式(如下所示)计算财务年度
= Iif( Month(Fields!calendardate.Value)<=3, Year(Fields!calendardate.Value)-1, Year(Fields!calendardate.Value))
对于SQL:
CASE WHEN Month(rTranslog.IssueDate)<=3 THEN YEAR(rTranslog.IssueDate)-1 ELSE YEAR(rTranslog.IssueDate) END