Find First Day and last Day of Month

Sunil Soni
Posted by Sunil Soni under Sql Server category on | Points: 40 | Views : 2659
DECLARE @Month smallint
SET @Month = 1
SELECT DAY(DATEADD(Month, DATEDIFF(Month, -1, getdate()) - 2, -1) + 1) as FirstDayofMonth,
DAY(DATEADD(Month, DATEDIFF(Month,0,getdate())+@Month, -1)) as LastDayOfMonth

Comments or Responses

Posted by: Pervej on: 9/22/2011 Level:Starter | Status: [Member] | Points: 10
http://getproductprice.com/Search.aspx?c=0-0-0&f=month

Login to post response