• So what do you want to do if there's an access late in the day and no exit until the next day?

    Also, what do you want CONSECUTIVE_D to be if it spans a weekend?

    Last but not least, I disagree with the rule of using the earliest entry date for this. Someone could come in and immediately turn around and walk out without closing the door and still have "hours worked" accrued. Same thing with the latest exit. They could exit and then later follow someone in and exit "for real and have "hours worked" accrued the whole time they're gone.

    For sure, this system should NOT be used for a timekeeping system of [font="Arial Black"]any [/font]type.

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