Question - How can I find the last day of the month?
Answer -
You can combine T-SQL's DATEADD() and DATEDIFF() functions to calculate different date and time values. Subtract 5ms from the first day of the next month to find the last day of the current month:
SELECT DATEADD(ms,-5,DATEADD(mm, DATEDIFF(m,0,GETDATE() )+1, 0))