cancel
Showing results for 
Search instead for 
Did you mean: 

My ref Q16 - Add OITB to OITW & OITM

Former Member
0 Kudos

Hi,

I have a report to which I need to add the field oitb.itmsgrpnam but not sure how to join it in, anyone's help would be appreciated.

Script as it stands:

SELECT t0.itemcode,t1.itemname, cast(t0.onhand as int) as 'Stock', cast (t0.iscommited as int) as 'Sales Orders', (cast(t0.onhand as int) - cast(t0.iscommited as int)) as 'Free Stock', t1.lstevlpric, t1.frgnname

FROM oitw t0 inner join oitm t1 on t0.itemcode = t1.itemcode

WHERE t0.whscode = '[%0]' and t0.onhand > t0.iscommited

ORDER BY t1.itemcode asc

Thanks,

Robin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi.........

Try this......

SELECT t0.itemcode,t1.itemname, cast(t0.onhand as int) as 'Stock', cast (t0.iscommited as int) as 'Sales Orders', (cast(t0.onhand as int) - cast(t0.iscommited as int)) as 'Free Stock', t1.lstevlpric, t1.frgnname, T2,ItmsGrpNam
FROM oitw t0 inner join oitm t1 on t0.itemcode = t1.itemcode Inner Join OITB T2 On T1.ItmsGrpCod=T2.ItmsGrpCod
WHERE t0.whscode = '%0' and t0.onhand > t0.iscommited
ORDER BY t1.itemcode

asc

Regards,

Rahul

Former Member
0 Kudos

Rahul,

Spot on.............thanks,

Robin

Answers (0)