Query For AVG Price

SELECT Distinct T0.[ItemCode], T0.[DfltWH],   T0.[AvgPrice],   T0.[OnHand]

FROM OITM T0 

WHERE (T0.[AvgPrice]is Null or T0.[AvgPrice] = ‘0’) and   T0.[OnHand]>=0 and

T0.ByWH =’N’ and  T0.EvalSystem <> ‘F’

Union ALL

SELECT Distinct T0.[ItemCode], T0.[WhsCode], T0.[AvgPrice],  T0.[OnHand] 

FROM  OITW T0

INNER JOIN OITM T1 on T0.ItemCode = T1.ItemCode

WHERE ( T0.[AvgPrice]is Null or T0.[AvgPrice] = ‘0’) and 

T0.[OnHand]>=0 and   T1.ByWH = ‘y’ and   T1.EvalSystem <> ‘F’

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply