I have to compare records from 2 different database. Examples below. I need to compare them based on barcode and see if their locations are different from database 2. If they match, then it says "Yes." If not, it returns the location from the db2. If it cannot find a barcode in the database 2, then it should return a value something like "not found." How do I do this?
The output should look something like this:
Excel Workbook | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Database 1 | Database 2 | ||||||
2 | Bar Code | Location | Bar Code | Location | ||||
3 | 090001141131 | 101A018 | 090001141131 | 101A018 | ||||
4 | 017025743001 | 101A024 | 017025743001 | 101A024 | ||||
5 | 017033021001 | 101A040 | 017033021001 | 101A040 | ||||
6 | 017069637001 | 101A093 | 011000346001 | 115B006 | ||||
7 | 017189535401 | 101B002 | 011000407001 | 115D116 | ||||
8 | 018622294001 | 101C046 | 011000822001 | 107H062 | ||||
... |
The output should look something like this:
Excel Workbook | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | Database 1 | Database 2 | |||||||
2 | Bar Code | Location | Match? | Bar Code | Location | ||||
3 | 090001141131 | 101A018 | Yes | 090001141131 | 101A018 | ||||
4 | 017025743001 | 101A024 | Yes | 017025743001 | 101A024 | ||||
5 | 017033021001 | 101A040 | Yes | 017033021001 | 101A040 | ||||
6 | 017069637001 | 101A093 | 115B006 | 011000346001 | 115B006 | ||||
7 | 017189535401 | 101B002 | 115D116 | 011000407001 | 115D116 | ||||
8 | 018622294001 | 101C046 | Not found | 011000822001 | 107H062 | ||||
... |