Hello
I am trying to get a table attribute to calculate the result of 2 attribute in another table. I am using SQL Server 2005. I got another table to do this and it works fine, but the only difference is is that the attributes are in the same table. My code is posted below but it does not Work. I get the message:
-------------------------------------------------------------------------
The multi-part identifier "ITEM_PURCHASE.LocalCurrencyAmt" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "ITEM_PURCHASE.ExchangeRate" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "ITEM_PURCHASE.LocalCurrencyAmt" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "ITEM_PURCHASE.ExchangeRate" could not be bound.
------------------------------------------------------------------------
CREATE TABLE WAREHOUSE(
ItemNumberSK int NOT NULL,
ItemName char(50) NOT NULL,
ItemUnitPrice as CASE
WHEN ITEM_PURCHASE.LocalCurrencyAmt > 0 AND ITEM_PURCHASE.ExchangeRate > 0 Then ITEM_PURCHASE.LocalCurrencyAmt * ITEM_PURCHASE.ExchangeRate * 1.2
END,
ItemQty numeric(7, 0) NOT NULL,