Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query using unrelated tables

Status
Not open for further replies.

kooley

Technical User
Jan 8, 2003
19
0
0
US
I am trying to write a query that will pull information from 3 different tables that can not be linked in any way. Is there a way? My formulas in the query are getting confused because the same fields exist (ie Account number, Loan Amt)in all the tables but there is no common information in these fields. One table contains current registrations from Brokers, another table contains closed registrations, and the last table contains archived loans sold to the government. I could really use some help as we are taking each of these tables into Excel & then cutting & pasting into worksheets to create a combined report.
 
You may not be able to get the data using 1 query if I understand you correctly. If you are getting similar data from each table you can use a UNION. Statement would be like:

Select a,b,c from tableA Where someconditions
UNION
Select d,e,f from tableB Where someconditions
UNION
Select g,h,i from tableC where someconditions;

In this case the data must be of the same type in each column of the data you are retrieving (e.g. a, d, and g must be numeric, etc.) You would reference the data in the report by using the column names in the first select statement of the union.

If the data is totally unrelated, you can create 3 queries and 3 reports. These 3 reports would then be subreports to a fourth report.

Hope this helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top