Solved

MsAccess table comparisons

Posted on 2011-03-24
5
254 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
see my note to Jo.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now