If you are using oracle and open work order are those where history flag is 0
select *
from workorder
where istask = 0 and historyflag =0 and targcompdate < trunc(sysdate,'month')
If open workorders are those where not closed or canceled or completed (WAPPR,INPRG,APPR ,WSCH ... etc)
select *
from workorder
where istask = 0 and targcompdate < trunc(sysdate,'month') and status not in (select value from synonymdomain where domainid = 'WOSTATUS' and maxvalue in ('CAN','CLOSE','COMP'))
------------------------------
Omar Abou Ammar
Senior Technical Consultant
eSolutions FZ-LLC
Dubai
------------------------------