fixed bug in sql query for a dedupe report