Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pre vs Post Table Comparison

Status
Not open for further replies.

rossmcl

Programmer
Apr 18, 2000
128
Hi

I have 2 tables (one called PRE, one called POST) with 60 fields each, linked by a unique key.

The data in the fields should be the same, this is what I need to check.

What is the best way to compare the data based on the unique key. I need to compare all fields. I dont want to have to run a doifferent query for each of the 60 fields so I created a simple function that compares the values of PRE and POST and was going to use this for each of the fields in one query, but the problem is a lot of the fields contain nulls in PRE but not in POST so I get errors when running my query

I guess my question is 1, should I even be using a query to compare the fields, or should I using ADO. Then, how do I compare a Null with a Value. What do I declare the values in my function as? I cant do it as a String can I?

Your help would be greatly appreciated.
Regards
rossmcl
 
Try the simple route first. In your function that is failing because of the nulls use this type construct:

If strString & "" = strString & "" Then

Then any null will be replaced and the value will be empty.

Steve King Professional growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top