Question : SQL statement (left join) not working as expected

I have a table called luDocumentTypes which has Insurance and License document types.  I have another table called tblContractorDocuments.

Currently there are 4 type of Insurance related document types in luDocumentTypes and 3 License related document types.

I need a query that will return all insurance types for each contractorID.  I thought that was an easy Left Join (show all luDocumentTypes) but that's not working.  I have attached the sql statement I tried.

I am needing
Type 1        Contractor 1       DocType 1         expires 3//1/08
Type 2       Contractor 1       DocType 2           null
Type 3       Contractor 1      DocType 3            expires 5/1/08
Type 4      Contractor 1      DocType 4            null

Type 1      Contractor 2        DocType 1        null
Type 2    Contractor 2          DocType 2        expires 8/1/08
etc...
Code Snippet:
1:
2:
3:
4:
SELECT tblContractorDocuments.ContractorID, luDocumentTypes.DocumentTypeID, luDocumentTypes.DocumentType, tblContractorDocuments.DocumentNumber, tblContractorDocuments.ExpireDate
FROM luDocumentTypes LEFT JOIN tblContractorDocuments ON luDocumentTypes.DocumentTypeID = tblContractorDocuments.DocumentTypeID
WHERE (((luDocumentTypes.IsInsurance)=True))
ORDER BY tblContractorDocuments.ContractorID, luDocumentTypes.DocumentType;

Answer : SQL statement (left join) not working as expected

got it...I did the cartisan (or however it's spelled) join first...
1:
2:
3:
4:
5:
SELECT dt.DocumentTypeID, dt.DocumentType, dt.ContractorID, tblContractorDocuments.DocumentNumber, tblContractorDocuments.ExpireDate
FROM (SELECT tblContractors.ContractorID, luDocumentTypes.DocumentTypeID, luDocumentTypes.DocumentType
FROM luDocumentTypes, tblContractors
WHERE (((luDocumentTypes.IsInsurance)=True))
ORDER BY tblContractors.ContractorID, luDocumentTypes.DocumentType) AS dt LEFT JOIN tblContractorDocuments ON (dt.DocumentTypeID = tblContractorDocuments.DocumentTypeID) AND (dt.ContractorID = tblContractorDocuments.ContractorID)
Random Solutions  
 
programming4us programming4us