Skip to Content

FMS to display sum of four warehouse onhand

Hi All,

When i'm raising the sale order, It's showing overall onhand in instock column. But i want to know the Sum of four warehouse onhand. I have use the below FMS, but it's not showing the exact figure.

SELECT SUM (T0.[OnHand]) FROM OITW T0 WHERE T0.[WhsCode] = 'WH07' or T0.[WhsCode] = 'WH08' or T0.[WhsCode] = 'WH04' or T0.[WhsCode] = 'WH05' and T0.ItemCode = $[$38.1.0] GROUP BY T0.ItemCode

Cheers!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 13, 2017 at 12:43 PM

    Hi,

    This is because of the ORs that you have used.

    Please try this:

    SELECT SUM(T0.[OnHand]) 
    FROM OITW T0 
    WHERE T0.[WhsCode] IN ('WH07', 'WH08', 'WH04', 'WH05') 
      and T0.ItemCode = $[$38.1.0] 
    GROUP BY T0.ItemCode

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded