65.9K
CodeProject is changing. Read more.
Home

SQL Get the last date of the month

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.78/5 (5 votes)

Nov 18, 2009

CPOL
viewsIcon

22560

An alternative version of "SQL Get the last date of the month"

declare @Date datetime
set @Date = '2009/10/17'
Select dateadd(day, 0 - day(dateadd(month, 1 , @Date)), dateadd(month, 1 , @Date))