[AccessD] Comparing Values of Fields

Colby, John JColby at dispec.com
Tue Nov 2 09:37:00 CST 2004


IN SQL you can do this using aliased fields to find the differences:

SELECT MyFld1, TheirFld1, NoMathcFld1: MyFld1 <> TheirFld1, 
	MyFld2, TheirFld2, NoMathcFld2: MyFld2 <> TheirFld2,
	....

Thus any true in any NoMatchFldX is a place where the field values don't
match.

In the where clause do a huge NoMatchFld1 OR NoMatchFld2 etc to pull all
such records.

Now you have all of the records with some field that doesn't match and
indicator flags telling you which field(s).  I am confident you can take it
from there.  ;-)

John W. Colby
The DIS Database Guy


-----Original Message-----
From: Nicholson, Karen [mailto:cyx5 at cdc.gov]
Sent: Tuesday, November 02, 2004 9:55 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Comparing Values of Fields


We are maintaining a parts database.  I have the master parts database
for manufacturers in a table named tblParts.  The manufacturer submits
to us an updated parts list in a table named tblMrfParts.

tblParts contains 25 fields.

tblMfrParts contains the same 25 fields.

I need to compare the values in the 25 fields, tying part number to part
number.  If the value in the tblMfrParts is different for that part
number for any field, show our database field value and the
manufacturers field value.  

Suggestions?  Come on, I answered a question today...
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list