Calculate First Day of Given Year

Bandi
Posted by Bandi under Sql Server category on | Points: 40 | Views : 274
To do expiration/retention period datetime calculation, this below kind of queries are useful......

DECLARE @Date datetime = '1947-10-27 '
SELECT DATEADD(yy,DATEDIFF(yy,0,@Date),0) FirstDayOfCurrentYear

Comments or Responses

Login to post response