Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / SQL

SQL Get the last date of the month

3.78/5 (5 votes)
18 Nov 2009CPOL 22.6K  
An alternative version of SQL Get the last date of the month
SQL
declare @Date datetime
set @Date = '2009/10/17'
Select dateadd(day, 0 - day(dateadd(month, 1 , @Date)), dateadd(month, 1 , @Date))

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)