SBO库龄分析报表

SELECT T0.ItemCode, T0.BatchNum, T0.ItemName, T0.Quantity, T0.CreateDate


,'0-30'=case when T0.CreateDate >= getdate()-30 then T0.Quantity else 0 end
,'31-60'=case when T0.CreateDate >= getdate()-60 and T0.CreateDate < getdate()

-30 then T0.Quantity else 0 end
,'61-90'=case when T0.CreateDate >= getdate()-90 and T0.CreateDate < getdate()

-60 then T0.Quantity else 0 end
,'91-180'=case when T0.CreateDate >= getdate()-180 and T0.CreateDate <

getdate()-90 then T0.Quantity else 0 end
,'181-360'=case when T0.CreateDate >= getdate()-360 and T0.CreateDate <

getdate()-180 then T0.Quantity else 0 end
,'360++'=case when T0.CreateDate < getdate()-360 then T0.Quantity else 0 end
,T0.CardCode, T0.CardName
FROM OIBT T0 WHERE WhsCode='BJ111' and T0.Quantity <>0

你可能感兴趣的:(职场,休闲,Sbo,SBO库龄分析,SBO库龄,sbo软件)