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!

Creating Net Change and New Records to insert/update

Status
Not open for further replies.

agcrump

Programmer
Aug 22, 2000
1
US
I am looking for a way to compare two tables. If the rows are the same, ie all columns match, then I want to throw that record away. If all the columns are the same except for 1 numeric column, then I want to update the record with the difference of the numeric column. If any of the other columns are different then I want to insert that row.

TBL1
Col1 Col2 Col3
A B 10
C D 5

TBL2
Col1 Col2 Col3
A B 30
C D 5
E F 17

Resulting TBL3
Col1 Col2 Col3
A B 20
E F 17
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top