Changed Records

  • Thread starter Thread starter John S.
  • Start date Start date
J

John S.

How do you find a changed record by comparing two tables. I am looking for
price changes, inventory quantity, contact names, etc.

I have used the unmatched query to find new and deleted records, but having
problems finding altered records.

Thanks John
 
John

?You have two tables holding the same (same kind) of data? This is an
unusual design for a relational database.
 
The data came from a relational database. I am attempting to compare the
data after a period of time to see how many records have been altered. I am
looking for new items added to a customer, price changes, billing status,
contact name, and any other changes that can be made to the different fields
in a database.

Due to time constraints, I probably will need to purchase a 3rd party
add-in. The only other issue is that I wanted to learn how to do this.

Another day perhaps!

Thanks for your response.

John
 
Hi John,

Here is a "general form" that you might use
(in addition to unmatched query):

Michel's solution was to move the mismatch
condition(s) to the WHERE clause and
use NZ:

SELECT
tbl1.*,
tbl2.*
FROM
tbl1 INNER JOIN tbl2
ON
tbl1.ID = tbl2.ID
WHERE
NZ(tbl1.f1 <> tbl2.f1, -1)
OR
NZ(tbl1.f2 <> tbl2.f2, -1)
OR
NZ(tbl1.f3 <> tbl2.f3, -1)
.......
OR
NZ(tbl1.fn <> tbl2.fn, -1)


It will include where "Null=Null" though,
but will catch where they "do not match"
including where one is Null and other is
not Null.

That may be enough to see what you
need to do hopefully.

Good luck,

Gary Walter

"John S." wrote
 
Back
Top