Skip to Content
0
May 22, 2020 at 12:05 PM

how to find items not issued for more than 3 months and less than 9 months

93 Views

items not issued for more than 3 months and less than 9 months

try below query but not working.

Select distinct t2.WhsName, T.ItemCode,T.ItemName,T.OnHand,t.U_MRPRate,t1.WhsCode,t2.WhsName
From OITM T inner join oitw t1 ON T.[ItemCode] = T1.[ItemCode]
 INNER JOIN OWHS T2 ON T1.[WhsCode] = T2.[WhsCode]
 Where not exists (Select T0.ItemCode FROM OINM T0
   WHERE T0.ItemCode =T.ItemCode
       and  T0.DocDate <  getdate()-90) and t.OnHand>0 and t2.WhsCode  in ( 'RM -RM','RM20-RM')