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 2007

Tip: Looking for answers? Try searching our database.

join two queries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
FL - 06 Nov 2007 21:51 GMT
I have two queries and each count like records for a certain field.   The
results of each query has a different total of records for each result.  For
example one query has 30 records and the other results in 15 records.  The
data is accurate.

I want to join the two results and create a chart.  Unfortunately, I'm
having trouble joining them into one query with the same results (30+15 = 45
records).  I did join common fields but the results are short records.
Signature

FL

John W. Vinson - 06 Nov 2007 22:55 GMT
>I have two queries and each count like records for a certain field.   The
>results of each query has a different total of records for each result.  For
[quoted text clipped - 4 lines]
>having trouble joining them into one query with the same results (30+15 = 45
>records).  I did join common fields but the results are short records.

You don't need a Join here - that joins two recordsets "side to side".
Instead, you need a UNION query. To create one, you must go to the SQL window:

SELECT thisfield, thatfield, theotherfield FROM firstquery
UNION ALL
SELECT somefield, anotherfield, athirdfield FROM secondquery;

The number and datatypes of the fields must match; as in my example, the names
need not.

See the online help for UNION for more details.

            John W. Vinson [MVP]
 
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.