Re: Query to find differences in a record



Something like this, perhaps:


SELECT tbl1.SSN, tbl1.FirstName,
tbl2.FirstName
FROM tbl1 INNER JOIN tbl2
ON tbl1.SSN = tbl2.SSN
WHERE tbl1.FirstName<>tbl2.FirstName;

--

Ken Snell
<MS ACCESS MVP>



"kayabob" <kayabob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5F398750-F0F8-4127-BF74-A8B3AEB46F6D@xxxxxxxxxxxxxxxx
>I want to make a query to find the differences in various fields for
> matching records. For example, I have two tables with SSN as the PK. I
> know
> that the SSN's make a one to one match from table 1 to table 2, but what I
> want to find are differences for a single SSN where on table 1 the
> FirstName
> is Chuck, but on table 2 the first name is Charles. I have to check for
> the
> differences for 45 fields (addresses, phones, etc etc). I tried something
> like this:
> SELECT tbl1.[field 1]
> FROM tbl1, tbl2
> WHERE (((tbl1.[field 1])<>[tbl2]![field 2]));
>
> but I cant get it to work for multiple fields combining with OR. Plus
> this
> seems too hard to do for 45 fields. Any suggestions of any easy way to do
> this would be appreciated.
>
> Thanks.


.



Relevant Pages