• Thank you again for the assistance and education. I will be more careful with my test data next time. The system locks up whenever I try to post anything too long, so here is my shortened version

    with ordered as (

    select d.a, d.b, d.dte

    , _a = lag(a, 1, null) over (order by a, dte)

    , _b = lag(b, 1, null) over (order by a, dte)

    from #date d)

    select *

    from ordered o

    where not exists (select o.a, o.b

    intersect

    select o._a, o._b);