In my previous blog post i have demonstrated how to find first and last date of any month. SQL Server 2012 has introduced a new date function EOMONTH to find the last day of the month.
EOMONTH ( start_date [, month_to_add ] )
Date expression specifying the date for which to return the last day of the month.
Optional integer expression specifying the number of months to add to start_date.
EOMONTH function is available in SQL Server 2012 and higher, for SQL Server 2008 R2 and below you can refer to this blog post.