Comparing tables

  • Thread starter Thread starter RA
  • Start date Start date
R

RA

I collect reports weekly from an automated system. I save the reports as
individual tables in Access. All of the fields are identically names. I
need a query that will look through the newest table and comparer it to the
prior table (I know that part may be manual) and show only the items that
changed, old value and new value (and the additions or deletions in a single
query would be nice)
 
I found it:

SELECT [Cisco 7-29].EnterpriseName, [Cisco Very Old].EnterpriseName
FROM [Cisco 7-29] INNER JOIN [Cisco Very Old] ON [Cisco 7-29].RouteID =
[Cisco Very Old].RouteID
WHERE [Cisco 7-29].EnterpriseName<> [Cisco Very Old].EnterpriseName;
 
The INNER join will only show those that match identically. Any additions
and deletions will be omitted. Use a LEFT join to show additions.

I think it would be better to use only one table and append each week, have
a field to identify the date. Then in your query have two instances of the
same table, the second will have a sifix '_1' added by Access. Then set
criteria on the first one for latest date and on second one for earlier
date(s).

--
KARL DEWEY
Build a little - Test a little


RA said:
I found it:

SELECT [Cisco 7-29].EnterpriseName, [Cisco Very Old].EnterpriseName
FROM [Cisco 7-29] INNER JOIN [Cisco Very Old] ON [Cisco 7-29].RouteID =
[Cisco Very Old].RouteID
WHERE [Cisco 7-29].EnterpriseName<> [Cisco Very Old].EnterpriseName;


RA said:
I collect reports weekly from an automated system. I save the reports as
individual tables in Access. All of the fields are identically names. I
need a query that will look through the newest table and comparer it to the
prior table (I know that part may be manual) and show only the items that
changed, old value and new value (and the additions or deletions in a single
query would be nice)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top