I need to find mismatches between tables So my problem is basically that I have an accounting table that has transaction references, and supporting document numbers.  Some of the document numbers have become mismatched from their actual transaction number.  The worst part is that the bad document numbers are actually valid, but reference a bad transaction. So here's the important part:

Every transaction has two parts.
Reference#, Type (Type A and Type B), and a document number. 

I need to find all transactions where either (REF#, Type A)'s DOC# doesn't equal (REF#, Type B)'s DOC#, or where there is no matching Type A or Type B transaction at all.
Nevermind, I think I got this.

Used subselect to create a TypeA table and a TypeB table, joined on REF# and searched for TypeA.DOC# != TypeB.DOC#