UPDATE LoanAccount
SET LoanAmount = (
SELECT ((la.LoanAmount * (DATEDIFF(DAY, la.LoanDate, GETDATE()) * (la.InterestRate / la.LoanTerm)))) + la.LoanAmount
FROM Customer c, LoanAccount la
WHERE c.Customer_ID = la.Customer_ID
AND c.AccountNumber = 213451
)
, LoanDate = GETDATE()
WHERE Customer_ID = 2;
I cannot update all LoanAmount for the Customer with ID=2, this is the message
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Any solution for this