Try modifying the query. The following line should not be a part of the join structure itself, but rather a filter for the join structure:
OITW.WareHouseCode in ('WH1','WH2','WH4')
Put it in as a
WHERE
clause:
SELECT
OITM.ItemCode,
sum(StockHand - OrderQty) AS NetStockHand
FROM
OITM inner join
WITM on OITM.ItemCode = WITM.ItemCode inner join
OITW on OITM.ItemCode = OITW.ItemCode
WHERE
OITW.WareHouseCode in ('WH1','WH2','WH4')
GROUP BY
OITM.ItemCode
HAVING
sum(StockHand - OrderQty) <> WITM.LastUStock