Answers for "previous year start and end date in swl"

1

previous year start and end date in swl

--To get the first day of the previous year in SQL Server, use the following code:
SELECT DATEADD(yy, DATEDIFF(yy, 0, GETDATE()) - 1, 0)
--To get the last day of the previous year:
SELECT DATEADD(dd, -1, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0))
Posted by: Guest on September-07-2021

Code answers related to "previous year start and end date in swl"

Browse Popular Code Answers by Language