I don't have the SQL sytstem infront of me to test the code.. But try using the below one and see if it brings the last day of the previous month?
DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), -1)
I don't have the SQL sytstem infront of me to test the code.. But try using the below one and see if it brings the last day of the previous month?
DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), -1)