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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Use Info from 2 Queries in 1 Report

Status
Not open for further replies.

Eventine

Technical User
Oct 11, 2004
1
US
Hi there, I am not an SQL programmer but a heavy user of Access in "user" mode :p

I need to pull data from 2 different queries (which references 2 different tables) into 1 report.

I have 1 table of lawsuits, with 2 sub-tables, table A lists all the injured people in each lawsuit and table B lists all the relatives of each injured person for each lawsuit.

The report needs to display for each lawsuit the count of the injured plaintiffs from A and the relatives from B. I can generate queries and reports to display these individually, but how do I get them into 1 query or report without error. I can make a query that will do this, but because some lawsuits don't have any relatives, my query completely omits any lawsuit that has no entries in table B.

Suggestions?
 
You should be able to make the relationship show all records from table A and only those records in table B which are related. Edit relationship and click the "join type" button - the #2 or #3 choice should be to show all records from the lawsuits table and only those records from the relatives table where the joined fields are equal.

Let them hate - so long as they fear... Lucius Accius
 
Base a main report on the lawsuit table. Add two subreports to the detail section that are based on the two related tables. Set the Link Master/Child properties to the primary key from the main table and foreign keys from the related tables.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top