Before you can write code you need finish defining the problem. It particular what it is definition of "deviation".
All you have specified is what the key variables are, but not how to compare the two datasets. Are you looking for records that match on key variables but differ on one or more non-key variables? Insertions? Deletions? If you want to calculate a percent deviation what it your numerator? What is your denominator?
First figure out how to do it for one table before attempting to convert it to a macro.
... View more