2 tbls, 1 rpt w/ all recs from 1st and only appropriate recs from

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two tables. Examples: Vehicles and Maintenance Records.
I have two queries. Examples: Vehicles and Maintenance Records.


The Vehicles table contains 2000+ records. Based on a specified criteria,
only 553 records will be pulled with the first query.

The Maintenance Records table contains 2500+ records. Based on the same
criteria, there are ~400 records that will be pulled with the second query.

When I combine this information from the two queries, only 148 of the 553
vehicles in my report because of the restrictive criteria.

What I need is a report that gives me all 553 vehicles and the ~400 records
from the Maintenance table on the associated pages. The final report should
be approximately 553 pages (one for each vehicle) in length and only 148 of
those pages will contain data from the maintenance table.

Please help me!!!!
 
BCS@AU said:
I have two tables. Examples: Vehicles and Maintenance Records.
I have two queries. Examples: Vehicles and Maintenance Records.


The Vehicles table contains 2000+ records. Based on a specified criteria,
only 553 records will be pulled with the first query.

The Maintenance Records table contains 2500+ records. Based on the same
criteria, there are ~400 records that will be pulled with the second query.

When I combine this information from the two queries, only 148 of the 553
vehicles in my report because of the restrictive criteria.

What I need is a report that gives me all 553 vehicles and the ~400 records
from the Maintenance table on the associated pages. The final report should
be approximately 553 pages (one for each vehicle) in length and only 148 of
those pages will contain data from the maintenance table.


The first step in creating a report is to create a query
that collects the desired data. It sounds like you are
having trouble joining your two existing queries into the
one query needed for the report, in which case you should
post the two existing queries and explain how their data is
related.

Without that information, about all I can guess at is that
you might get what you want if you use an outer join to
connect the records from the two queries.

Actually, I will even question the need for your two
queries. It's possible that you can just join the two
tables and use the appropriate WHERE clause all in one
query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top