We help IT Professionals succeed at work.

How do I compare two fields to list all records that do not match?

shwelopo
shwelopo asked
on
147 Views
Last Modified: 2014-08-19
I'm trying to compare field1 in table1 which has 4600 records with field2 in table2 which has 9500 records to list all records in table1 that are not in table2.
Comment
Watch Question

akalyan911Technical Consultant

Commented:
Hey.. you have to import the data first and then only can compare. without importing the data, you can't compare.

Author

Commented:
this is my query, it doesn't seem to work right.

select distinct SUBSTRING(table1.field1, 1, 6) from table1
where
field1

not in (select SUBSTRING(table2.field2, 1, 6) from table2)
Sean FitzpatrickSr Lab Systems Engineer

Commented:
there's a command to compare data from two tables, but you will have to import all the data into a single spreadsheet first as akalyan911 stated.

Here's some examples of what you can do with tables.

http://office.microsoft.com/en-us/excel-help/use-excel-to-compare-two-lists-of-data-HA001103915.aspx
Information Technology Specialist
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.