SQL going back to start and end of month for 2 months ago
Posted on 2014-03-13
I need to build out 2 parameters for a start and end date that goes back 2 months. In this example, it is currently March so my start date will be 1/1/2014 and my end date will be 1/31/14.
I got the start date with this: =DateAdd("m", -2, DateSerial(Year(Now()), Month(Now()), 1))
If I use this for the end date: =DateAdd("d", -1, DateSerial(Year(Now()), Month(Now()), 1))
it obviously brings in 2/28/14 instead of 1/31/14. I'm not sure how to combine the 2 for my end date so it becomes 1/31/14.