Home Forums SQL Server 2005 SQL Server 2005 General Discussion How to join multiple tables (SQL) to find the difference between an order and shipped quantities? RE: How to join multiple tables (SQL) to find the difference between an order and shipped quantities?

  • Thanks for all the help! I feel like I could write this query with just a push in the right direction, but for some reason I'm hitting a brick wall pretty early on.

    I figure I need to:

    Get the quantity of each product from the OrderItems per order

    Get the quantity shipped for each correlating PO in the shipping table

    subtract the two quantities and display the result, per item.

    I was doing so with temp tables - inserting all orders, removing all orderIDs from the temp table that had a full match on qty ordered + qty shipped, and trying to report on the order status of the remaining records. That's not helping my SQL knowledge grow in any way, though.