Maximo Open Forum

 View Only
Expand all | Collapse all

List Planned Labor for a Workorder in a query the same as the Maximo does in the Plans tab Planned Labor

  • 1.  List Planned Labor for a Workorder in a query the same as the Maximo does in the Plans tab Planned Labor

    Posted 02-06-2023 09:28
    HI there.  I have been working on a query that when you select a workorder from the WPLABOR table, it will display all the planned labor including the Planned labor associated to the task work orders.  I can do this like Maximo does with an imbedded query, but I need to return the plan labor craft, skills description and the quantity.  

    Any thoughts would be appreciated.  Thanks

    I'm sure I'm either missing something or approaching this incorrectly.  Here is an example of what I'm trying to do.

    select * from maximo.wplabor where
    wonum in (select a.wonum from maximo.workorder a, MAXIMO.WPLABOR b where (a.wonum=b.wonum or (a.parent=b.wonum and a.istask = 1)))
    and wonum = '<My WONUM>

    ***This will work, but I don't want the WONUM imbedded in the in statement***
    select * from maximo.wplabor where
    wonum in (select wonum from maximo.woancestor where ancestor = <MY WONUM>)

    select * from maximo.wplabor where
    (wonum=<MY WONUM> or exists (select 1 from maximo.workorder w where w.parent=<MY WONUM>
    and w.istask=1 and wplabor.siteid=w.siteid and wplabor.wonum=w.wonum)) and wplabor.siteid='NTS'
    #Administration

    ------------------------------
    Brian Swanson
    MSTS (Mission Support & Testing Services)
    ------------------------------


  • 2.  RE: List Planned Labor for a Workorder in a query the same as the Maximo does in the Plans tab Planned Labor

    Posted 02-07-2023 07:58
    HI Brian,

    If my understanding is correct , the below query can give you the details,

    select laborcode,craft,skilllevel,quantity from wplabor where (wonum=:wonum and siteid=:siteid) or wonum in (select wonum from activity where wogroup=:wonum and siteid=:siteid)

    hope you are passing the Parent WONUM and SITEID as the bind variables.

    ------------------------------
    Subhransu Sekhar Sahoo
    Tata Consultancy Services
    ------------------------------