Last Day of a Month

Posted by Kirthiga under Sql Server category on | Points: 40 | Views : 1175
Declare @LastDay datetime='2013-02-25'
select DATEADD(MM,DATEDIFF(MM,0,@LastDay)+1,0)-1 [LastDay Of a Month]

Comments or Responses

Posted by: Pandians on: 5/22/2013 Level:Silver | Status: [Member] [MVP] | Points: 10

In another way!
Declare @LastDay datetime='2013-02-25'

SELECT DATEADD(Month,1,@LastDay) - DAY(@LastDay) [LastDay Of a Month]

Login to post response