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

Popular posts from this blog

This content database has a schema version which is not supported in this farm

Export all documents/Folders permissions to CSV using SharePoint PowerShell

SPUtility.js