Wednesday, April 2, 2014

Date Functions in TSQL

To get the first date of the week by passing the week id

dateadd(wk, datediff(wk, 0, getdate()), 0)

To get the last date of the week by passing the week id

dateadd(wk, datediff(wk, 0, getdate()), 0) + 6