Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

MsAccess table comparisons

Posted on 2011-03-24
5
278 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

856 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