I received a request that I thought would be simple but is turning kind of complex. I need to add a calculated column that will show the “Total Value” of a Customer Shipment. I join the order num and line on the shipment to order dtl to grab the DocExtPriceDtl from orderdtl.
You could create a subquery (CTE) that does a group by OrderNum and sums the amounts. You can then link to that CTE in this query and pull the calculated total as a column.
EDIT: Also, don’t forget to look at the ShipMisc and DropShip tables if you do any of those in your orders.