cancel
Showing results for 
Search instead for 
Did you mean: 

FMS to display sum of four warehouse onhand

former_member320372
Participant
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

Johan_H
Active Contributor
0 Kudos

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

former_member320372
Participant

Hi,

Thanks Johan Hakkesteegt. It's working... 🙂

Answers (0)