Monday, February 20, 2012

POs and closed PO lines (was "I think this is an easy one..")

I have a table for PO's and a table for PO lines. I need to select the list of PO numbers where the related PO lines are closed. What is the best way to do this. My first inclination is to write a query to count the number of attached lines for each master PO and then correlate a subquery selecting the count of closed lines and where they match close the master PO. Is that the best way to do this or have I overthunk. TIACount the lines that are NOT CLOSED and if ZERO, then close the master PO :D

No comments:

Post a Comment