Returning data from table based on date ranges

  • Ah... understood on the offsets.  Thanks, Jeff.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Hi @Jeffrey Williams,

    Wow, thank you for taking the time to put that together. I have tried it on my machine and it looks good. The production server this will run on is actually SQL 2008R2 so I think it will need tweaking to run on that as some of the functions are not compatible.

    Thanks again to all who have looked and commented.

  • You can remove the CONCAT function or modify to use + to build that string.  That column isn't used.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 3 posts - 16 through 18 (of 18 total)

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