Monday, 31 October 2011

Find First and Last Day of Current Year in Sql Server

select convert(datetime,convert(nvarchar,datepart(year,getdate()))+'-1-1') as 'Current Year First Date',
convert(datetime,convert(nvarchar,datepart(year,getdate()))+'-12-31') as 'Current Year Last Date'


Tag: Current Year, First Day, Last Day, Sql server

No comments:

Post a Comment

Parsing JSON w/ @ symbol in it

To read the json response like bellow @ concatenated with attribute                             '{ "@id": 1001, "@name&q...