jbalbo
SSCertifiable
Points: 7583
More actions
May 14, 2014 at 3:21 pm
#291335
Hi
Not sure how to setup how to setup a statement to get the first and last day of the month for 4 months prior
for example: If getdate() was6/1/2014 I would want 2/1/2014 and 2/28/2014
Thanks
Joe
May 14, 2014 at 3:25 pm
#1713639
sorry found it
,dateadd(month, datediff(month, 0, getdate()) - 4, 0)
,dateadd(month, datediff(month, -1, getdate()) - 4, -1)
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply