SQL Get the last date of the month






3.78/5 (5 votes)
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))
3.78/5 (5 votes)
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))