• change your WHERE Clause like below

    WHERE A.connected = 0 AND dt.connected IS NOT NULL


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/