I have three tables with Customer Name as a Primary key.




I would like to combine all three tables via Customer Name and Sum the Quantities.
Please help me to combine the third table as well.
I managed to combine a single table but unable to add the second table. My query is something like this
SELECT Stock.Customer, SUM(Stock.[Available Quantity]) AS AvailableQty, O.ShippedQty
FROM (SELECT Storer, SUM([Shipped Quantity]) AS ShippedQty
FROM Dispatch
GROUP BY Customer) AS O LEFT OUTER JOIN
Stock ON Stock.Customer= O.Customer
GROUP BY Stock.Customer, O.ShippedQty