To get the last of the month in TSQL. We can use the built in function EOMONTH. Alternatively, we can also combine the built in function of DATEADD and DATEDIFF.
See below TSQL queries for example. We are going to get the last day of current month.
SELECT EOMONTH(GETDATE()) AS LASTDAYOFMONTH
SELECT DATEADD(MONTH, 1 + DATEDIFF(MONTH, 0, GETDATE()), -1) AS LASTDAYOFMONTH