Skip to Content
0

FMS to display sum of four warehouse onhand

Jan 13, 2017 at 12:33 PM

41

avatar image

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!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Johan Hakkesteegt Jan 13, 2017 at 12:43 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi,

Thanks Johan Hakkesteegt. It's working... :)

1