Joins

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 tables, a Trial Balance & a Budget. I have the
Account & Cost Center fields joined. When I run it I want
to show everything & what I mean is the Budget when there
is no Actual activity & the Activity when there is no
Budget (of corse also Activity & Budget when they both
have a value).

Dan
 
You need the equivalent of FULL OUTER JOIN, which Access doesn't support
directly. You can get a similar (but not updatable) result with a UNION and
two outer joins:

SELECT TableA.*, TableB.*
FROM TableA LEFT JOIN TableB
ON TableA.Key = TableB.Key
UNION ALL
SELECT TableA.*, TableB.*
FROM TableA RIGHT JOIN TableB
ON TableA.Key = TableB.Key
WHERE TableA.Key IS NULL;

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top