>What I am trying to do is create a generic ContactInfo table that has a field of ContactType to tell what type on contact it is, and then link to that table from a query where I only want a specific ContactType (in this case, 1). I thought the following join statement would work, but it seems to ignore that part of the statement.
>
>
>FROM ContactType RIGHT OUTER JOIN
> ContactInfo ON ContactType.ContactTypeID = ContactInfo.ContactType AND ContactInfo.ContactType = 1 RIGHT OUTER JOIN
> CustAddr ON ContactInfo.CustNum = CustAddr.CustNum
>
>
>Anybody know what I am doing wrong? Thanks!
You right joined CustAddr to ContactInfo, that means you want all records from CustAddr and mathching records ContactInfo.
FROM ContactType
RIGHT JOIN ContactInfo ON ContactType.ContactTypeID = ContactInfo.ContactType AND ContactInfo.ContactType = 1
RIGHT JOIN CustAddr ON ContactInfo.CustNum = CustAddr.CustNum
I would do something different (becuase I didn't see any reasons for RIGHT JOIN)
FROM ContactInfo
LEFT JOIN ContactType ON ContactType.ContactTypeID = ContactInfo.ContactType
LEFT JOIN CustAddr ON ContactInfo.CustNum = CustAddr.CustNum
WHERE ContactInfo.ContactType = 1
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.