match query

analysis_paralysis

New Member
Joined
Mar 12, 2009
Messages
16
Hello,
I'm stumped and I need help.
I am trying to run a query that reverses the unmatch query which is not a problem. However, I need to find matches (is NOT null) on 5 different fields.
essentially, both tables that I am querying off of have addresses broken down into
Address Number
Address Street
Address City
Address State
Address Zip

I need to find get the records that all of these fields match in both tables.
help would be great! :) the sooner the better, my boss wants to know the list of potential customers that live with former customers and this is the best way I have found (using address of potential customer with those 5 fields and pushing it against existing customer base).

Thanks,
A_P
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

james_lankford

Well-known Member
Joined
Jan 11, 2009
Messages
1,207
in Access 2003
click
Queries
on the left of the Objects box
then click
Create query in Design view
then a box will show up asking you to select some tables
click
Close
then in the top menu. select
View
SQL view
then paste this

Code:
select 
  p.*,
  e.* 
from 
  [Potential Customers] as p
  inner join
  [Existing Customers] as e
on
  p.[Address Number] = e.[Address Number] 
  and
  p.[Address Street] = e.[Address Street]
  and
  p.[Address City] = e.[Address City]
  and
  p.[Address State] = e.[Address State]
  and 
  p.[Address Zip] = e.[Address Zip]
look where it says
from
I'm assuming your 2 tables are named
Potential Customers
and
Existing Customers
if they aren't then you'll have to change that
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,893
Messages
5,834,274
Members
430,273
Latest member
Windrunner

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top