Calculate financial year start and end date SQL Server
DECLARE @year INT = 2012
SELECT
STDATE = DATEADD(MONTH, 3, DATEADD(YEAR, DATEDIFF(YEAR, 0, DATEADD(YEAR, @year - 1900, 0)), 0)),
ENDDATE = DATEADD(DAY, -1, DATEADD(MONTH, 3, DATEADD(YEAR, DATEDIFF(YEAR, 0, DATEADD(YEAR, @year - 1900, 0))+1, 0)))
Comments
Post a Comment