a.previousSeqNo lastSeqNoDoing,c.operationDesc,d.operationDesc as lastOperationDesc
a.previousSeqNo lastSeqNoDoing,c.operationDesc,d.operationDesc as lastOperationDesc,dbo.Get_ProductionLineDesc(a.Site,dbo.Get_WorkCenter_ProLineNo(a.site,sos.S_WorkCenterNo)) ProductionLineDesc
from SOScheduledRouting a left join SOScheduledRouting b on a.Site=b.Site and a.previousSeqNo=b.SeqNo
from SOScheduledRouting a left join SOScheduledRouting b on a.Site=b.Site and a.previousSeqNo=b.SeqNo
left join v_sorouting c on a.Site=c.Site and a.OrderNo=c.OrderNo and a.ItemNo=c.ItemNo
left join v_sorouting c on a.Site=c.Site and a.OrderNo=c.OrderNo and a.ItemNo=c.ItemNo
left join v_sorouting d on b.Site=d.Site and b.OrderNo=d.OrderNo and b.ItemNo=d.ItemNo
left join v_sorouting d on b.Site=d.Site and b.OrderNo=d.OrderNo and b.ItemNo=d.ItemNo