General information
Forum:
Microsoft SQL Server
Title:
Update with added value
Environment versions
SQL Server:
SQL Server 2005
Hi,
I try to update a file add value to the exiting value, the statement as follows:-
INSERT INTO amaster
(cmdb, cmcr, ccmdb, ccmcr)
SELECT damt + amaster.cmdb AS Expr1, camt + amaster.cmcr AS Expr2, cdamt + ccmdb AS Expr3, ccamt + ccmcr AS Expr4
FROM transact
WHERE (acctno = amaster.acctno)
I have the following error on exec.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "amaster.acctno" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "amaster.cmdb" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "amaster.cmcr" could not be bound.
Msg 207, Level 16, State 1, Line 3
Invalid column name 'ccmdb'.
Msg 207, Level 16, State 1, Line 3
Invalid column name 'ccmcr'.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only