I have been using the query below to try to provide an accurate stock level from two tables tbl_Delivery and tbl_Sale. I can produce results from 2 queries (qry_DelivertTotals and qry_SalesTotals) that summarise how many of each product have been delivered and how many have been sold. Whilst I can get stock level data for products that have sales recorded against them, the resulting query won't provide any data for products that have been delivered but for which there have been no sales.
SELECT tbl_StockItems.RefNo, tbl_StockItems.[Model No], tbl_StockItems.Description, qry_DeliveryTotals.SumOfNumber, qry_SalesTotals.SumOfNumber, [qry_DeliveryTotals.SumOfNumber]-[qry_SalesTotals.SumOfNumber] AS in_stock
FROM (qry_SalesTotals INNER JOIN qry_DeliveryTotals ON qry_SalesTotals.[Model No] = qry_DeliveryTotals.[Model No]) INNER JOIN tbl_StockItems ON qry_DeliveryTotals.[Model No] = tbl_StockItems.[Model No]
ORDER BY tbl_StockItems.[Model No];
Could someone please suggest a modification to this script that will include products for which there have been no sales?
Regards
JohnR
SELECT tbl_StockItems.RefNo, tbl_StockItems.[Model No], tbl_StockItems.Description, qry_DeliveryTotals.SumOfNumber, qry_SalesTotals.SumOfNumber, [qry_DeliveryTotals.SumOfNumber]-[qry_SalesTotals.SumOfNumber] AS in_stock
FROM (qry_SalesTotals INNER JOIN qry_DeliveryTotals ON qry_SalesTotals.[Model No] = qry_DeliveryTotals.[Model No]) INNER JOIN tbl_StockItems ON qry_DeliveryTotals.[Model No] = tbl_StockItems.[Model No]
ORDER BY tbl_StockItems.[Model No];
Could someone please suggest a modification to this script that will include products for which there have been no sales?
Regards
JohnR