Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MsAccess table comparisons

Posted on 2011-03-24
5
Medium Priority
?
308 Views
Last Modified: 2012-06-21
Hi All -

I have two huge tables (900,000+) that have the exact same structures. I would like to compare every field (93) in each table to determine where the differences are. A field in Table A could have a Null and the same-name fields in Table B could be a zero. Also, corresponding fields in each table could both be Null.

I tried a join (just to produce exact records in each table) but that did not seem to be working as I wanted.

Any ideas?

Lenny

0
Comment
Question by:LennyGray
  • 4
5 Comments
 
LVL 2

Expert Comment

by:jo_m
ID: 35206617
Hello Lenny

 a few quick questions to start
do the tables have a primary key,
are the sort orders matched,
is it likely that whole rows or blocks of records will be  missing
is it just to field content level or are we looking for diffences or data types as well

tx

jo
0
 
LVL 10

Author Comment

by:LennyGray
ID: 35207744
Hi Jo -

This is a nightmare user request <sigh>

1. There is no primary key in either table
2. I sorted the tables but there could be duplicates, but I am unsure
3. There will be missing rows from each side of the matching
4. The data types should be the same between Table A and Table B but I am uncertain.

Ideally, I would like to determine the records that matched, the unmatched A and unmatched B records.

Thanks,
Lenny
0
 
LVL 10

Accepted Solution

by:
LennyGray earned 0 total points
ID: 35210085
Thanks Jo... I solved it myself.

I performed a query that updated every field in both tables using the NZ function. Then I did the matches. The default replacements in the NZ replaced the NULL value with a date (my birthday) or a Character (X) or an Integer (0).
0
 
LVL 10

Author Comment

by:LennyGray
ID: 35234190
Here is a useful command-line utility to check the contents of two tables with the same structure. The resulting text file indicates the field name and value that differed between the two tables being compared.

The executable is a Microsoft utility named: tablediff.exe. You can find details in:

You can find the syntax, optional switches and an example in: http://msdn.microsoft.com/en-us/library/ms162843.aspx

0
 
LVL 10

Author Closing Comment

by:LennyGray
ID: 35239120
see my note to Jo.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question