G
Guest
Hi there,
I am trying to build a query from five linked tables: tblAgreement,
tblParty, tblPartyContact, tblRenewalConditions, and tblAssignment. I am
running into a common problem (I've read dozens of other postings complaining
of the same thing) but can't figure out how to fix it: basically the query
will not turn out records if a field in any of the above tables is null. So I
am getting only a partial set of results that meet my criteria.
I suspect the proper "JOIN" language would solve the problem, but I'm new to
Access and just don't get JOINs!
Here's my SQL:
SELECT tblParty.PartyName, tblAgreement.AgName, tblSubsidiary.[Subsidiary
Name], tblAgreement.EffectiveDate, tblRenewalConditions.[Renewal Conditions],
tblAgreement.Comments, tblAssignment.Assignment, tblPartyContact.FirstName,
tblPartyContact.LastName, tblPartyContact.ContactTitle, tblParty.Address1,
tblParty.Address2, tblParty.City, tblParty.State, tblParty.ZipCode,
tblParty.Country
FROM tblRenewalConditions INNER JOIN (tblSubsidiary INNER JOIN
(tblAssignment INNER JOIN (tblPartyContact INNER JOIN (tblParty INNER JOIN
tblAgreement ON tblParty.PartyID = tblAgreement.PartyID) ON (tblParty.PartyID
= tblPartyContact.PartyID) AND (tblPartyContact.ContactID =
tblAgreement.ContactID)) ON tblAssignment.AssignmentID =
tblAgreement.AssignmentID) ON tblSubsidiary.SubsidiaryID =
tblAgreement.SubsidiaryID) ON tblRenewalConditions.RenewalID =
tblAgreement.RenewalID
WHERE (((tblAgreement.[Expired/Terminated])=0) AND ((tblAgreement.Draft)=0)
AND ((tblAgreement.AssignmentID)=2 Or (tblAgreement.AssignmentID)=5));
Or do I maybe need to do a UNION query? If so, would I still need to change
the JOIN language so as not to exclude null values?
Thanks in advance for your help!
Laura Christian
I am trying to build a query from five linked tables: tblAgreement,
tblParty, tblPartyContact, tblRenewalConditions, and tblAssignment. I am
running into a common problem (I've read dozens of other postings complaining
of the same thing) but can't figure out how to fix it: basically the query
will not turn out records if a field in any of the above tables is null. So I
am getting only a partial set of results that meet my criteria.
I suspect the proper "JOIN" language would solve the problem, but I'm new to
Access and just don't get JOINs!
Here's my SQL:
SELECT tblParty.PartyName, tblAgreement.AgName, tblSubsidiary.[Subsidiary
Name], tblAgreement.EffectiveDate, tblRenewalConditions.[Renewal Conditions],
tblAgreement.Comments, tblAssignment.Assignment, tblPartyContact.FirstName,
tblPartyContact.LastName, tblPartyContact.ContactTitle, tblParty.Address1,
tblParty.Address2, tblParty.City, tblParty.State, tblParty.ZipCode,
tblParty.Country
FROM tblRenewalConditions INNER JOIN (tblSubsidiary INNER JOIN
(tblAssignment INNER JOIN (tblPartyContact INNER JOIN (tblParty INNER JOIN
tblAgreement ON tblParty.PartyID = tblAgreement.PartyID) ON (tblParty.PartyID
= tblPartyContact.PartyID) AND (tblPartyContact.ContactID =
tblAgreement.ContactID)) ON tblAssignment.AssignmentID =
tblAgreement.AssignmentID) ON tblSubsidiary.SubsidiaryID =
tblAgreement.SubsidiaryID) ON tblRenewalConditions.RenewalID =
tblAgreement.RenewalID
WHERE (((tblAgreement.[Expired/Terminated])=0) AND ((tblAgreement.Draft)=0)
AND ((tblAgreement.AssignmentID)=2 Or (tblAgreement.AssignmentID)=5));
Or do I maybe need to do a UNION query? If so, would I still need to change
the JOIN language so as not to exclude null values?
Thanks in advance for your help!
Laura Christian