Glen, if you'd like to find all open parent work orders for which all child work orders are either in COMP status or else have been closed or canceled, you can use the following where clause:
workorder.historyflag = 0 and workorder.istask = 0 and workorder.haschildren = 1 and not exists (select 1 from workorder wo where wo.parent = workorder.wonum and wo.siteid = workorder.siteid and wo.historyflag = 0 and wo.status <> 'COMP' )
If you want to limit your results to just those parents for which all children are in COMP status (excluding parents for which any children have already been closed or canceled), you could eliminate the wo.historyflag = 0 from the nested select statement.
If you want to that limit the results to parent work orders for which all non-task children orders are in COMP status or are already closed (i.e., ignore the status of tasks), then you could add "and wo.istask = 0" to the nested select statement.
If the business reason for this query is to find open parents that are not yet in COMP status and for which all child work orders are completed or closed, then you could add workorder.status <> 'COMP' to the beginning of the where clause.