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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

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
Back
Top