PC Review


Reply
Thread Tools Rate Thread

compare tables

 
 
=?Utf-8?B?Z2VlYmVl?=
Guest
Posts: n/a
 
      3rd May 2006
hi,
I have 2 tables I want to develop a comparison query for. i want the output
to be like this:

3 columns:
acct# intable1? intable2?


so the query should pull all account numbers from both tables, but the
output should be listed in 3 columns as above. i want to see if an account
number is in both tables, and if not, in which table?

thanks in advance,
geebee

 
Reply With Quote
 
 
 
 
MGFoster
Guest
Posts: n/a
 
      3rd May 2006
geebee wrote:
> hi,
> I have 2 tables I want to develop a comparison query for. i want the output
> to be like this:
>
> 3 columns:
> acct# intable1? intable2?
>
>
> so the query should pull all account numbers from both tables, but the
> output should be listed in 3 columns as above. i want to see if an account
> number is in both tables, and if not, in which table?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just use 2 queries:

What acct_nbrs are in table1 and NOT in table2?

SELECT table1.acct_nbr
FROM table1 LEFT JOIN table2 ON table1.acct_nbr = table2.acct_nbr
WHERE table2.acct_nbr IS NULL


What acct_nbrs are in table2 and NOT in table1?

SELECT table2.acct_nbr
FROM table2 LEFT JOIN table1 ON table1.acct_nbr = table2.acct_nbr
WHERE table1.acct_nbr IS NULL

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRFkQ2YechKqOuFEgEQL5QwCgjrvyDIZsD/UgEQp5wfE6qFLomVYAnAuU
C+DKxde6X3T5CBQpbT/WKBPV
=JcKu
-----END PGP SIGNATURE-----
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare two tables? tom Microsoft Access 6 26th Nov 2006 09:56 PM
need to compare between 2 tables yuvalbra@gmail.com Microsoft Excel Programming 3 24th Jan 2006 10:40 AM
Compare two tables Trusty Microsoft Access VBA Modules 1 8th Sep 2004 06:59 AM
Compare tables Steve B Microsoft Access Queries 1 2nd Oct 2003 05:33 PM
Compare tables Jeff Clarke Microsoft Access Queries 0 29th Sep 2003 01:57 PM


Features
 

Advertising
 

Newsgroups
 


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