TomBarrand
Programmer
I have the following UPDATE statement and I am having problems with the where clause for it, any suggestions?
UPDATE Temp_FOBL
SET FOB_No =
(select FOB_No from FOB, Temp_FOB
where FOB.Purch_Ord_No = Temp_FOB.Purch_Ord_No AND FOB.FOBI_Line_No = Temp_FOB.FOBI_Line_No)
where FOB.Purch_Ord_No = Temp_FOB.Purch_Ord_No AND FOB.FOBI_Line_No = Temp_FOB.FOBI_Line_No
When I execute it through the query analyizer I get the following errors:
Server: Msg 107, Level 16, State 3, Line 1
The column prefix 'FOB' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'Temp_FOB' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'FOB' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'Temp_FOB' does not match with a table name or alias name used in the query.
UPDATE Temp_FOBL
SET FOB_No =
(select FOB_No from FOB, Temp_FOB
where FOB.Purch_Ord_No = Temp_FOB.Purch_Ord_No AND FOB.FOBI_Line_No = Temp_FOB.FOBI_Line_No)
where FOB.Purch_Ord_No = Temp_FOB.Purch_Ord_No AND FOB.FOBI_Line_No = Temp_FOB.FOBI_Line_No
When I execute it through the query analyizer I get the following errors:
Server: Msg 107, Level 16, State 3, Line 1
The column prefix 'FOB' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'Temp_FOB' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'FOB' does not match with a table name or alias name used in the query.
Server: Msg 107, Level 16, State 1, Line 1
The column prefix 'Temp_FOB' does not match with a table name or alias name used in the query.