I have a stored procedure that I need to schedule to run on the 30th of the month.
The SP needs to have a Start Date of Previous Month/15/YYYY and End Date Current Month/14/YYYY.
I was thinking I could just use MONTH(DateAdd(MM,1, getDate()) and then append the rest of the date here.
So for example last month I need to have the date range to be 11/15/2017 to 12/14/2017. This month I need the range to be 12/15/2017 to 01/14/2018.
How do I get the years to change when appropriate?
Using MS SQL 2014