• Thank you for your help!!

    Each driver dispatch date and truck number represents a separate truck run and I need to find only those matches where the first driver is sleeping and the second driver is off duty for each separate truck run. The driver table has hundreds of separate truck runs each day.

    SD_RID OVL_START OVL_END DRIVER_DISPATCH_DT TRUCK DRIVER_ID STATUS DRIVER_START_DATE DRIVER_END_DATE

    --------- ----------------------- ----------------------- ------------------ ----------- ----------- ------ ------------------ ------------------

    1 2016-06-25 10:01:00.000 2016-06-25 18:27:00.000 25-JUN-16 00:00:00 1234 1 SLEEP 25-JUN-16 08:30:00 25-JUN-16 23:12:26

    5 2016-06-25 12:01:00.000 2016-06-25 16:59:00.000 25-JUN-16 00:00:00 1234 2 OFDTY 25-JUN-16 12:01:00 25-JUN-16 17:00:00

    9 2016-06-25 08:00:00.000 2016-06-25 21:45:00.000 25-JUN-16 00:00:00 1356 5 SLEEP 25-JUN-16 09:00:00 25-JUN-16 19:00:00

    14 2016-06-25 12:01:00.000 2016-06-25 16:59:00.000 25-JUN-16 00:00:00 1356 5 OFDTY 25-JUN-16 12:01:00 25-JUN-16 17:00:00