?? on First and last day on 4 months prior

  • 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

  • sorry found it

    ,dateadd(month, datediff(month, 0, getdate()) - 4, 0)

    ,dateadd(month, datediff(month, -1, getdate()) - 4, -1)

    Thanks

    Joe

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply