I need to get the last day of the month given as a date in SQL. If I have the first day of the month, I can do something like this:
DATEADD(DAY, DATEADD(MONT
---Start/End of previous Month Declare @StartDate datetime, @EndDate datetime set @StartDate = DATEADD(month, DATEDIFF(month, 0, GETDATE())-1,0) set @EndDate = EOMONTH (DATEADD(month, DATEDIFF(month, 0, GETDATE())-1,0)) SELECT @StartDate,@EndDate