I have a column called Description which has an account number plus text ie 123456 July 2016 Statement. There is also a column that has the account number ie 123456.
In another table I have a reference number ie 100001234. I want to be able to update the Description column to show 100001234 - 123456 July 2016 Statement. The reference number will be different for each account number but there is ONLY 1 reference number per account.
Have tried doing REPLACE but needs 3 arguments or get
Incorrect syntax near 'description'
Code:
SELECT
t.[Referencenumber],
SET [description] = (REPLACE ([Description], referencenumber + ' - ' + [Description])),
c.[ClientID], [AccountID]
FROM
[Document].[dbo].[DOC.Client] AS c
INNER JOIN
[Reporting].[dbo].[Tran] AS t ON t.Id = c.accountid
Any suggestions?