Need LOTS of help on a Query!!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a list of 50 names (A) and a list of 550 names (B).
I want to use the names in list A to filter/query list B.
List B contains address, contact and map info, list A is
a weekly delivery schedule.
So I need a way to quickly show only those
names that appear on list A in list B.

TIA
Isaac Sanchez
 
Matching on names is usually not very reliable, but on the ASSUMPTION that
the names are entered exactly the same in both tables, all you need to do is
join the tables on the names field.

SELECT B.*
FROM B Inner Join A
ON B.[Names] = A.[Names]

In the query grid
-- Add both tables
-- drag from B.Names to A.Names
-- Add the fields you want to see to the grid
-- run the query

If the names are not exactly alike in the two tables, then you won't get a
match.
 
How are the names stored? FirstName, LastName in separate fields? Are you
SURE that names in both lists are spelled the same - or does one list
contain, say John M. Smith and the other J. MIchael Smith? You would be much
better off if each name in TableB was assigned a numeric ID, and TableA
contain only the ID's, not the names.
But given what you have, on the assumption that names are carried in two
fields and that they are known to be identically entered in both tables:

SELECT TableB.* FROM TableB
INNER JOIN TableA ON TableA.LastName = TableB.LastName
AND TableA.FirstName = TableB.FirstName
 
Thanks for the replies,
I can assume that there are examples of this "Inner Join"
option in the help files?!?
Can I make it so that I can create a macro to run this
query weekly cause the list is going to change each week?

Isaac
 
You do not need the help file for inner joins, or even know they exist.
When you have the tables in the design screen simply click on name in one
table and drag and drop the line to the corresponding name in the other
table.

You can create a macro to run the query on demand, or you can simply double
click on the query name to run it anytime.


isanchez2769 said:
Thanks for the replies,
I can assume that there are examples of this "Inner Join"
option in the help files?!?
Can I make it so that I can create a macro to run this
query weekly cause the list is going to change each week?

Isaac
 
Of course there are examples (and explanations) of JOINs in the help
file. As David pointed out you don't really have to understand them to
use them, but as this is the quintessential way to bring related
information together in a database the knowledge will serve you well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top