• maybe something along these lines.....???

    WITH cte AS

    (

    SELECT CID,

    CDate,

    Dept,

    row_number() OVER (PARTITION BY cid,dept ORDER BY cid,cdate,dept) rn

    FROM #tTable

    )

    SELECT CID,Cdate,Dept

    FROM cte

    WHERE rn = 3 AND dept = 'C'

    ORDER by cid,cdate

    edit...simplified

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day