• my first guess looks pretty good;

    just using row number, and joining the data against itself:

    WITH MySampleData

    AS

    (

    SELECT row_number() OVER(partition by date order by date,time,seqno) AS RW,

    *

    from #tmp

    )

    SELECT

    T1.*,

    T2.*

    FROM MySampleData T1

    LEFT OUTER JOIN MySampleData T2 ON T1.RW + 1 = T2.RW

    WHERE T1.seqno IS NULL AND T2.seqno IS NULL

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!