G
Guest
In the following query, the CostQualityOrder table includes categories. Not
all category headings have a matching record in my query. When I run this
query, only categories where P/FCostQuality is not null are counted. How can
I re-write the query to list ALL category headings and for those that have a
null value in the P/FCostQuality field to include it in the query results as
0? I have changed RIGHT JOIN to LEFT JOIN and get the same results. Thanks.
SELECT CostQualityOrder.CostQuality, Count(AllPartsqry.[P/FCostQuality]) AS
CountCQ, AllPartsqry.[P/FCostQuality]
FROM AllPartsqry RIGHT JOIN CostQualityOrder ON AllPartsqry.[P/FCostQuality]
= CostQualityOrder.Order
WHERE (((AllPartsqry.[Make/Buy])="p") AND ((AllPartsqry.Status)=1))
GROUP BY CostQualityOrder.CostQuality, AllPartsqry.[Model#],
AllPartsqry.[P/FCostQuality]
HAVING (((AllPartsqry.[Model#])=[forms]![Rpt_CostQualityQuad]![Model]) AND
((AllPartsqry.[P/FCostQuality]) Is Not Null));
all category headings have a matching record in my query. When I run this
query, only categories where P/FCostQuality is not null are counted. How can
I re-write the query to list ALL category headings and for those that have a
null value in the P/FCostQuality field to include it in the query results as
0? I have changed RIGHT JOIN to LEFT JOIN and get the same results. Thanks.
SELECT CostQualityOrder.CostQuality, Count(AllPartsqry.[P/FCostQuality]) AS
CountCQ, AllPartsqry.[P/FCostQuality]
FROM AllPartsqry RIGHT JOIN CostQualityOrder ON AllPartsqry.[P/FCostQuality]
= CostQualityOrder.Order
WHERE (((AllPartsqry.[Make/Buy])="p") AND ((AllPartsqry.Status)=1))
GROUP BY CostQualityOrder.CostQuality, AllPartsqry.[Model#],
AllPartsqry.[P/FCostQuality]
HAVING (((AllPartsqry.[Model#])=[forms]![Rpt_CostQualityQuad]![Model]) AND
((AllPartsqry.[P/FCostQuality]) Is Not Null));