I am fairly new to SQL and was wondering if it's possible to create a query that will return all items committed to a specific sales order, including child items in production orders.
I began with 2 queries with UNION ALL but i get stuck when trying to make the where statement a variable (DocNum/OriginNum). If it helps we have a UDF setup in RDR1 [U_SO] where the production order # for that line item is entered.