bring three queries into one query by using Join Query!

  • Thread starter Thread starter Ashley
  • Start date Start date
A

Ashley

This work! but it only shows matching records by date
which are grouped in week number. How can I also get the
unmatching records to show up? Is it possible?
Please help!
Thanks

SELECT qryIntranetFinalTestTotal.FinalDate,
qryIntranetFinalTestTotal.FinalYield,
qryIntranetPreTestTotal.PrestestYield,
qryIntranetSafetyTestTotal.SafetyYield
FROM (qryIntranetFinalTestTotal INNER JOIN
qryIntranetPreTestTotal ON
qryIntranetFinalTestTotal.FinalDate =
qryIntranetPreTestTotal.PreTestDate) INNER JOIN
qryIntranetSafetyTestTotal ON
(qryIntranetFinalTestTotal.FinalDate =
qryIntranetSafetyTestTotal.SafetyDate) AND
(qryIntranetFinalTestTotal.FinalDate =
qryIntranetSafetyTestTotal.SafetyDate) AND
(qryIntranetPreTestTotal.PreTestDate =
qryIntranetSafetyTestTotal.SafetyDate);
 
This work! but it only shows matching records by date
which are grouped in week number. How can I also get the
unmatching records to show up? Is it possible?

You may need a couple of queries to do this: you can change the INNER
JOIN to LEFT (or RIGHT) OUTER JOIN to get all the records in one query
matched to any matching records in the other.

Unfortunately Access doesn't support a FULL OUTER JOIN which would
give you all the records in both tables, so you may need several Outer
join queries to cover all the possibilities - use a UNION query to
string the results together.
 
Back
Top