How to get only records that are in results of two seperate queries

  • Thread starter Thread starter Terri Jackman
  • Start date Start date
T

Terri Jackman

Hi!

I'm a novice user at Access 2000 and would appreciate
your help on a problem I am trying to solve.

I have two queries currently setup that give me correct
data. Is there a way to run these two queries together so
that I can obtain the results of records that are
contained in both queries. I can get the results of
records that are in "either/or" easily, but is there a way
to get an "and" result instead.

Many thanks for your expertise here.

Terri
 
Terri

If both queries return the same "kind" of fields, in the same order, and the
same number of fields, you can use a UNION query (see Access HELP on this
topic).

The basic notion is that you will take (for example):

Name, Address, Phone

from one selection criterion (say, everyone who had a birthday last month),
and

Name, Address, Phone

from a second selection criterion (next month's birthdays), and use a UNION
query to get a single list.

You will NOT be able to use the query grid to build the final UNION query.
You'll have to start a new, third query, set it to SQL view, then copy the
SQL statement of your first query into that new query, add the UNION
command, and copy/paste the second query's SQL statement. Syntax counts, so
check the HELP example.
 
Back
Top