Left join, Multiple Tables??

  • Thread starter Thread starter ehale
  • Start date Start date
E

ehale

Hello,

I'm stumped and would really appreciate any help the newsgroup can give -- I
have 3 tables: tblRisks, tblQuotes, tblNovaQuotes

I'm trying to get all tblRiskName and tblRiskState that exist in tblRisks to
show up regardless of whether there are associeated Qutoes. I need to the
query to show tblStatus, tblEffectiveDate, tblPolicy, tblGLPolicy,
tblTotalQuote from tblQuotes and tblumbStatus and tblumbFinalPrem from
tblNovaQuotes wherever the data exists.

There are relationships as follows:
tblRisks.tblRiskID = tblQuotes.tblRiskID
tblRisks.tblRiskID = tblNovaQuotes.tblRiskID
tblQuotes.tblQuoteID = tblNovaQuotes.tblQuoteID

Thanks in advance for any help.
 
Found the answer:

SELECT tblRisks.tblRiskName, tblRisks.tblRiskState, tblQuotes.tblStatus,
tblQuotes.tblEffectiveDate, tblQuotes.tblPolicy, tblQuotes.tblGLPolicy,
tblQuotes.tblTotalQuote, tblNovaQuotes.tblumbStatus,
tblNovaQuotes.tbumblFinalPrem
FROM (tblRisks LEFT JOIN tblQuotes ON tblRisks.tblRiskID=
tblQuotes.tblRiskID) LEFT JOIN tblNovaQuotes ON
tblQuotes.tblQuoteID=tblNovaQuotes.tblQuoteID;

Thanks!!
 
Back
Top