get the last day of the year sql code example
Example 1: sql server select first day of previous year
SELECT DATEFROMPARTS ( DATEPART(yyyy, GETDATE()) - 1, 1, 1 )
Example 2: sql server select furst day of current year
SELECT DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0)