Showing posts with label Last day of Month. Show all posts
Showing posts with label Last day of Month. Show all posts

24 April 2014

How to get last day of the month in SQL Server



DECLARE @date DATETIME
SET @date='2014-04-5'
SELECT DATEADD(dd, -DAY(DATEADD(m,1,@date)), DATEADD(m,1,@date)) AS LastDayOfTheMonth