Friday, April 3, 2009

How to Find the 1st Day of week and Last Date of a month

SELECT DATEADD(WK, DATEDIFF(WK, 0, getdate() - 2), 0)
select DAY(DATEADD (m, 1, DATEADD (d, 1 - DAY(getdate()), getdate())) - 1)

No comments: