Rabu, 25 Maret 2015

Re: [MS_AccessPros] All data in two tables

 

Luigi-


What you want is a FULL OUTER JOIN that Access doesn't support.  You can get the equivalent with a UNION query:

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

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Mar 25, 2015, at 8:33 PM, wrmosca@comcast.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I don't think you can do that. You see what happens with an outer join (your second example). You could do a UNION query to get all rows from both sides but they wouldn't be related.

-Bill Mosca


---In MS_Access_Professionals@yahoogroups.com, <no_reply@yahoogroups.com> wrote :

Hi all, hope everybody good and in shape!
I've a sort of "concept" question today...

I've two table, eg. tbl_budget and tbl_turnover, A query is showing, starting for tbl_budget the actual turnover and the differences... linking two fields (code).
Now, I would like to see ALL data from both tables, in the same views (form based on the query) eg:

tbl_budget tbl_turnover

code code

1 1 --> ok

3 --> I can see all data from tbl_budget setting the relation link ok

5 -->?? how can I see also this code in the same query ???


Thanks, hope it is clear...I suppose it is easy for a access master, but I'm not! :-)


Ciao!


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

.

__,_._,___

Tidak ada komentar:

Posting Komentar