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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare 2 Tables To Find Modifications

Status
Not open for further replies.

nextchapter612

Programmer
Oct 4, 2003
3
US
I receive an updated table (Table_currentdate)monthly which I use to populate a different table with any modified or added records. Is there away to compare Table_010103 against Table_020103 and make a new temporary table(Table_changes) of all the records (including new records)in Table_020103 that were modified and identify which fields were modified?

Any help is greatly appreciated.
 
There is an Oracle command called minus that would help but it doesn't work on memo fields and I don't know its MS-Access equivalent. It's tedious but you could always do it through code. Here's the logic you would need to implement.

Loop through records in Table_020103
construct where clause using record's primary key
use where clause to check for existing record in Table_010103
if no record found in Table_010103 then record is new
else
loop through each field in Table_020103
compare value to field value in Table_010103
if values differ ...
end loop
end if
end loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top