【发布时间】:2015-12-11 13:39:15
【问题描述】:
我正在尝试收集当前财政年度的所有数据。 请在下面查看我的代码。
select *
FROM dbo.vw_AN_Admin_VendorReturns
where
case month(getdate()) <4 -- If current month is less than April (old financial year)
year(RtnDt) = year(getdate()) and month(RtnDt) <4 or year(RtnDt) = year(getdate())-1 and month(RtnDt) >3
case month(getdate()) >3 -- If current month is more than March (New financial year)
year(RtnDt) = year(getdate()) and month(RtnDt) >3 or year(RtnDt) = year(getdate())+1 and month(RtnDt) <4
end
【问题讨论】:
-
无法理解你的问题..
-
解释一下你想做什么???
-
请发布示例数据和预期结果/
-
@Praveen 我如何发布数据?
-
@Krishn 在问题中包含数据或提供 sqlfiddle 链接