• tshad (8/20/2012)


    Actually, this is a stripped down version of the actual query I was using so it is a little difficult to do that.

    But I did figure out my issue, just not sure how to deal with it.

    The where clause is causing the problem. The Join is done fine but the the where clause filters out anything that doesn't have DealerCode ="11".

    The lines that have the null for a DealerCode, which the extra lines would have, were also filtered out.

    I needed to change Where clause to:

    WHERE dealercode = '11' OR dealerCode IS NULL.

    That works fine with one dealercode but if I have multiple dealercodes, it doesn't work as I get 3 records even if another dealercode is missing others so I can't tell which dealercode the extra records belong to.

    Thanks,

    Tom

    Put this, dealercode = '11' , in with the join criteria for the right outer join instead of in the WHERE clause. Let us know how that works.