Hello All,
As many know, the reason table has different reason types.
What reason type do I need to join to the Parttran InvAdjReason field? On the Open DMR status report, there is a reason code displayed and I had a user ask me to display the description. That is why I am trying to join the reason table.
In my left outer join, I have “r.ReasonType = ‘D’.” Is that the correct way to do this?
SELECT pt.TranNum,pt.InvAdjSrc,pt.InvAdjReason,pt.TranType,r.Description
FROM erp.PartTran pt
left outer join erp.Reason r on pt.InvAdjReason = r.ReasonCode and r.ReasonType = ‘D’
where pt.InvAdjSrc =‘other’ or pt.TranType in (‘other’,‘MTL-DMR’, ‘STK-DMR’, ‘SUB-DMR’,‘INS-DMR’)