willdevelope
Programmer
**The query will select the data fields find if I comment out the where clause but I am trying to compare two fields LOCATION_INVENTORY.onhandqty and ITEM.STORAGE_TEMPLATE if data LOCATION_INVENTORY.onhandqty don't match ITEM.STORAGE_TEMPLATE show me data.But if i remove where clause it will give me the selected data but not the way I need it to compare two fields. With where clause error out***Error converting data type nvarchar to numeric.***
SELECT
dbo.LOCATION_INVENTORY.ITEM,
dbo.ITEM.DESCRIPTION,
sum(dbo.LOCATION_INVENTORY.ON_HAND_QTY) as TotalonHandQty,
dbo.ITEM.ITEM_CLASS
FROM
dbo.LOCATION_INVENTORY
INNER JOIN dbo.ITEM ON (dbo.LOCATION_INVENTORY.ITEM = dbo.ITEM.ITEM)
--WHERE
--(dbo.LOCATION_INVENTORY.ON_HAND_QTY != dbo.ITEM.STORAGE_TEMPLATE)
group by dbo.LOCATION_INVENTORY.ITEM,
dbo.ITEM.DESCRIPTION,
dbo.ITEM.ITEM_CLASS
SELECT
dbo.LOCATION_INVENTORY.ITEM,
dbo.ITEM.DESCRIPTION,
sum(dbo.LOCATION_INVENTORY.ON_HAND_QTY) as TotalonHandQty,
dbo.ITEM.ITEM_CLASS
FROM
dbo.LOCATION_INVENTORY
INNER JOIN dbo.ITEM ON (dbo.LOCATION_INVENTORY.ITEM = dbo.ITEM.ITEM)
--WHERE
--(dbo.LOCATION_INVENTORY.ON_HAND_QTY != dbo.ITEM.STORAGE_TEMPLATE)
group by dbo.LOCATION_INVENTORY.ITEM,
dbo.ITEM.DESCRIPTION,
dbo.ITEM.ITEM_CLASS