Skip to Content
Author's profile photo Kennedy Thomas

Query For AVG Price

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’

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.