Home Forums SQL Server 2005 Development Converting sequential time records into IN and OUT times RE: Converting sequential time records into IN and OUT times

  • pssudarshan (3/27/2014)


    True. But the problem is that the IN time and the OUT time are not on the same row. My difficulty is in getting the IN time for a particular employee and date paired with the OUT time for the same employee and date and getting these two values on the same row to compute the time difference. Please bear in mind that there will be multiple IN and OUT times for each employee / day combination.

    Post a CREATE TABLE and some readily consumable data and I'll show you how to do it. See the first link under "Helpful Links" in my signature line below for how to do that.

    --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)