Query to retrieve 4 weeks and 3 days past RRS feed

  • Question

  • Hello,

    I need to write a query that returns a result set that is within the past 4 weeks and 3 days. For example, the result set for today would return everything from Feb 8th forward. (Date of this post was March 11).

    I have the week part but I am not sure how to include the 3 days. Any help would be appreciated.

    select dateadd(week,-4,getdate());

    Dave SQL Developer

    Monday, March 11, 2013 3:43 PM

All replies

  • Would this work?

    select dateadd(day,-3,dateadd(week,-4,getdate()));

    For every expert, there is an equal and opposite expert. - Becker's Law

    My blog

    Monday, March 11, 2013 3:51 PM