SQL Find Last Day of Any Month

I needed to determine tha last day of previous month in a view, i found this on internet and works great:

Following script demonstrates the script to find last day of previous, current and next month.----Last Day of Previous MonthSELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))LastDay_PreviousMonth----Last Day of Current MonthSELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0))LastDay_CurrentMonth----Last Day of Next MonthSELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+2,0))LastDay_NextMonth