The query retrieves too few records.

G

Guest

My query is not retrieving all of the records that should be included in the
dataset. I included the SQL for your review and maybe somebody can tell me
why its not working.

SELECT qryReportData.Order, qryReportData.[Created on], qryReportData.[Ship
To List name], qryReportData.[Ship to City], qryReportData.[Ship to State],
qryReportData.[Sales doc], qryReportData.[Purchase Order],
qryReportData.[Caller Name], qryReportData.[Clarify Number],
qryReportData.[Product No], qryReportData.[Product Serial],
qryReportData.[Part No#], qryReportData.[Part Description],
qryReportData.Quantity, qryReportData.[Cust Cost], qryRepairCosts.RepairCost,
qryTravelCosts.TravelCost
FROM (qryReportData LEFT JOIN qryRepairCosts ON qryReportData.Order =
qryRepairCosts.Order) LEFT JOIN qryTravelCosts ON qryReportData.Order =
qryTravelCosts.Order
WHERE (((qryReportData.[Cust Cost])<>0) AND ((qryRepairCosts.RepairCost) Is
Null Or (qryRepairCosts.RepairCost)<>0) AND ((qryTravelCosts.TravelCost) Is
Null Or (qryTravelCosts.TravelCost)<>0));

Please help.
 
M

[MVP] S.Clark

You have an outer join with criteria. Typically, this will result in the
query behaving as if it is an Inner join. Try breaking the query into
several queries, such that the criteria is handled seperate from the join.
 

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

Top