A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

comparing two tables



 
 
Thread Tools Display Modes
  #1  
Old May 28th, 2004, 04:26 AM
ADAK
external usenet poster
 
Posts: n/a
Default comparing two tables

I would like to comparing two tables.
The results to be a side by side comparisions of each record from the two dbs.
If the record in db-1 does not have a match in db-2, then db-2 will have a null field for that record, and the same should apply in db-2 if it has no match with db-1.
have tried the query wizard and the union and not getting the results that I am looking for.

ADAK
  #2  
Old May 28th, 2004, 06:07 PM
John Vinson
external usenet poster
 
Posts: n/a
Default comparing two tables

On Thu, 27 May 2004 20:26:02 -0700, "ADAK"
wrote:

I would like to comparing two tables.
The results to be a side by side comparisions of each record from the two dbs.
If the record in db-1 does not have a match in db-2, then db-2 will have a null field for that record, and the same should apply in db-2 if it has no match with db-1.
have tried the query wizard and the union and not getting the results that I am looking for.

This is called a "Full Outer Join" query which is, unfortunately, not
supported directly in Access.

To get around the problem, you need *three* queries. First create a
Query joining db1 to db2 (by the appropriate linking field), select
the join line in the query grid, and choose Option 2 - "Show all items
in db1 and matching records in db2". Save this as qryLeft.

Now create another similar query using Option 3, the Right Outer Join.
Save it as qryRight.

Finally, create a UNION query

SELECT * FROM qryLeft
UNION
SELECT * FROM qryRight;


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.