Hello, I need someones help. I am not sure what I am missing here.
I have been asked to create a BAQ containing the following:
List of Part Numbers on Hold
Type of Hold
ECR Number
Only the Latest Open Sales Order Number per part
Latest Open Sales Order Date per part
Example: Order 1 for part A was placed 6/01/2020. Order 2 for part A was placed 6/20/2020. I only want the Sales Order that was entered first which would be Order 1.
I have attempted to use the calculation field and used Min(OrderDate), however I still return multiple Sales order for each part. I only want one, the oldest sales order date per part number.
Here is what I have tried.
My failed results where the highlighted lines would be what I want displayed out of the group of results. Also not sure how to handle different orders for the same part that have the same date (Highlighted in Green):
Still need HELP!!
I am still running into issues. If I use the Top function, then I only return one row of data. I thought I needed to separate it all out into independent sub-queries, but that is still not working. Any ideas how to get this to work?
Here is what I have. I have made 2 sub-queries and a top level query, as shown below.
I have tried to use the “Top” and “Distinct Top” on both the ‘Order Details’ sub-query and the top query. When applied to the Sub-query ‘Order Details’ it returns only 1 row. When applied to the ‘Part and Order Detail’ top query, it returns 0 rows.
Sub-Query 1.) Parts on Hold Details
SubQuery Options:
Phase Build:
So it needs to be any part number that is on Eng hold AND has an open order against it. It can be a single stand alone order or one line on a multiple part order. Does that make sense?
Yes. What I’ve outlined above will give you a list of all the parts that are on an open order line, showing the order number with the oldest Order Date.
From there you can add you other tables to relate to the PartNum or the OderNum.