Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Partial Intersection on Multiple Query Results

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nicholas Kormanik - 16 Nov 2005 19:45 GMT
I have 8 large, complex queries:

q1, q2, q3, q4, q5, q6, q7, q8

Each one queries its own respective table:

t1, t2, t3, t4, t5, t6, t7, t8

Suppose there are names as part of each table, composed of three fields ---
first_name, middle_name, last_name.

I want to know the name set(s) common to all the 8 query results.

I will alter the queries, incrementally (all 8 querries), until I get a full
name set collection totalling around 100 names.

In other words, what will emerge are 100 names common to all the query
results.

Any thoughts on how best to do this?

One approach would be to combine all the 8 queries into one single
super-large query.  Yikes.

Thanks,
Nicholas
Jeff Boyce - 16 Nov 2005 20:02 GMT
Have you looked into creating a UNION query ... something like:

   SELECT whatever FROM t1
   UNION
   SELECT whatever FROM t2
   UNION
   ...

I believe there's a way you can get only unique values across the UNIONs
(check in Access HELP under UNION query).

Regards

Jeff Boyce
<Office/Access MVP>
>I have 8 large, complex queries:
>
[quoted text clipped - 24 lines]
> Thanks,
> Nicholas
Jeff Boyce - 16 Nov 2005 20:04 GMT
Another thought...

It is an "unusual" design to have multiple tables with the same fields.  You
may have a spreadsheet, not an Access database!

If you post more information about what kinds of data you are storing in 8
identical but separate tables, the 'group may be able to offer a design that
saves you all the work of UNION queries.

Regards

Jeff Boyce
<Office/Access MVP>

>I have 8 large, complex queries:
>
[quoted text clipped - 24 lines]
> Thanks,
> Nicholas
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.