SQL EOMONTH last year code example Example: mssql last day of month SELECT DATEADD(month, ((YEAR(getdate()) - 1900) * 12) + MONTH(getdate()), -1)