Why can’t I use this:
SELECT
coalesce (w.WarehouseCode,Mast.WarehouseCode) as WarehouseCode,
coalesce (w.QuantityOnHand,Mast.QuantityOnHand) as QuantityOnHand,
coalesce (w.QuantityOnSalesOrder,Mast.QuantityOnSalesOrder) as QuantityOnSalesOrder,
coalesce (w.QuantityOnPurchaseOrder,Mast.QuantityOnPurchaseOrder) as QuantityOnPurchaseOrder,
coalesce (w.QuantityOnBackOrder,Mast.QuantityOnBackOrder) as QuantityOnBackOrder
FROM
IM_ItemWarehouse_Master Mast
left join
IM_ItemWarehouse w on
w.WarehouseCode = Mast.WarehouseCode
AND w.Itemcode = '[ATRNUM]'
In the SQL Select Statement of a grid?
I get this error:
Error while accessing the database:
Column 'WarehouseCode' in field list is ambiguous
SELECT WarehouseCode, QuantityOnHand, QuantityOnSalesOrder, QuantityOnPurchaseOrder, QuantityOnBackOrder from IM_ItemWarehouse_Master Mast left join IM_ItemWarehouse w on w.WarehouseCode = Mast.WarehouseCode AND w.Itemcode = '10039atr'
Which shows a different Sql statement. Stripped of my coalesce.