A query based on several other queries when one of the other quer.

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

Guest

I have a query based on several other sub-queries. When one of the other
queries has no records found, the main query shows nothing for all of the
sub-queries.
 
This question is kind of vague. I mean, let's say you have a query based on
your customer table and you have
a bunch of subqueries providing things like max-price and last-orderdate
kind of stuff. And then you run the query for information on a customer who
was born yesterday (or worse yet....tomorrow), well you are going to get no
records and the query design is fine.
However, if the sub-query that is without records is not the linchpin of the
query then you may have a problem with the way you are joining the
sub-queries. I would suggest that you make a copy of your query and begin to
dissect it. If you know which of the subqueries is without records, change
the way it is joined to the rest of the query. Let's say the offending query
is called qryMaxPrice. Right click on the join in query design view and
select "Join Properties". If the Join is indicating that it is pulling "All
records from "qryMaxPrice" and only those from.........."
then change the join so that the logic is reversed.
Perhaps you have a subquery that is not joined to anything, for instance, an
OrderDetails query but you haven't brought the Orders Table into the query.
Could be a lot of things. If the above did not help, come back with more
details.
 
Back
Top