Hi Trevor, thanks for your reply. Please see below my sql for this report.
select
pk.MANUFACTUREORDER_I,
pk.ITEMNMBR,
iv.ITEMDESC,
pk.PPN_I as bomno,
sf.EMPLOYID,
sf.ACTUALSTARTDATE_I,
sf.ACTUALSTARTTIME_I,
sf.ACTUALFINISHDATE_I,
sf.ACTUALFINISHTIME_I,
sf.SEQUENCECOST_I,
sf.ELAPSEDTIME_I,
up.LASTNAME,
up.FRSTNAME,
(mp.QTYRECVD * mp.ITEM_COSTS_ARRAY_I_1) AS materialcost,
(sf.SEQUENCECOST_I) AS labor,
(sf.Variable_Overhead_Amount) AS overhead,
(os1.EXTDCOST) AS outsource,
CASE WHEN wo.MANUFACTUREORDERST_I = '1' THEN 'quote'
WHEN wo.MANUFACTUREORDERST_I = '2' THEN 'open'
WHEN wo.MANUFACTUREORDERST_I = '3' THEN 'released'
WHEN wo.MANUFACTUREORDERST_I = '4' THEN 'hold'
WHEN wo.MANUFACTUREORDERST_I = '5' THEN 'cancelled'
WHEN wo.MANUFACTUREORDERST_I = '6' THEN 'complete'
WHEN wo.MANUFACTUREORDERST_I = '7' THEN 'partially rec.'
WHEN wo.MANUFACTUREORDERST_I = '8' THEN 'closed'
END AS MOstatus,
ENDQTY_I AS plannedqty,
(mp.QTYRECVD) AS qtyrecvd
from
PK010033 pk
inner join MOP1000 mp on pk.MANUFACTUREORDER_I = mp.MANUFACTUREORDER_I AND pk.ITEMNMBR = mp.ITEMNMBR AND pk.seq_i = mp.PICKLISTSEQ
LEFT outer join SF010115 sf on sf.MANUFACTUREORDER_I = mp.MANUFACTUREORDER_I AND pk.RTSEQNUM_I = sf.RTSEQNUM_I
LEFT outer JOIN dbo.UPR00100 UP ON up.EMPLOYID = sf.EMPLOYID
LEFT OUTER JOIN OSRC1100 os1 on os1.MANUFACTUREORDER_I = mp.MANUFACTUREORDER_I AND os1.ITEMNMBR = mp.ITEMNMBR AND sf.RTSEQNUM_I = os1.RTSEQNUM_I
LEFT OUTER JOIN IV00101 iv on iv.ITEMNMBR = pk.PPN_I
LEFT OUTER JOIN dbo.WO010032 wo ON wo.MANUFACTUREORDER_I = pk.MANUFACTUREORDER_I --AND wo.ITEMNMBR = mp.ITEMNMBR
AND pk.ROUTINGNAME_I = wo.ROUTINGNAME_I
where
pk.QTY_ISSUED_I <> 0
Thanks,
babu