I am an intermediate access user, with very little to ZERO SQL knowledge. Here is my issue.
I have 2 tables that I want to compare and only pull specific records for voters that fit 2 criteria:
1. Pull only records with a matching “VID” field
2. Then with the VID’s that DO match, look at the “Address” field and only show records where the Address doesn’t match
I have the 2 tables attached, but wanted to paint a picture here….
Table 1 (In reality this table has over a million records):
VID (Primary Key) First Name Last Name Address City 111 John Smith 1234 main st Seattle 222 Eric Jenner 7890 low st Renton 333 Tina Fey 555 High st # 201 Tukwila 444 Leland Buck 888 S place Seattle 555 Vicki Moore 666 Satan’s lair Tacoma
Table 2 (this table has about 200-1000 records):
VID (Primary Key) Address City 111 1234 main st Seattle 222 999 Main St Seattle 333 4444 Low St Tukwila
I would like to create a query (below) that compares these 2 tables and then would show the following records:
Query:
VID (Primary Key) Address City 222 999 Main St Seattle 333 4444 Low St Tukwila
This query only pulls 2 records because only these 2 records match the criteria of 1- Same VID, then 2- The address fields DO NOT match (i don't care about city)
I cannot figure how to do this in 1 step, currently I have to run 2 query’s to get this, 1 to look at the matching VID’s and the other to look for address’s that are different.
Can someone help create a query for me that will pull the information I need?
Test_DB.zip