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
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

james_lankford

Well-known Member
Joined
Jan 11, 2009
Messages
1,178
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,232
Messages
5,594,956
Members
413,954
Latest member
mrsandy

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