Hi All
I realy hope someone can help me with this. I have a databse with Account Numbers and card Numbers that I match to a file to update any card numbers to account number so I only work with account numbers. I created a view linking the Table to the Account/Card db to return the Table ID and the related Account number. Now I need to update those records where the ID matches with the Account Number.
Sales_Import where the account number field needs to be updated
LeadID AccountNumber 147 5807811235 150 5807811326 185 7006100100007267039
RetrieveAccountNumber where I need to update from
LeadID AccountNumber 147 7006100100007266957 150 7006100100007267039
Tried the below but no luck
UPDATE [Sales_Lead].[dbo].[Sales_Import]
SET [AccountNumber]= (SELECT RetrieveAccountNumber.AccountNumber
FROM RetrieveAccountNumber
where [Sales_Lead].[dbo]
[Sales_Import].leadid=RetrieveAccountNumber.LeadID)
It updates the card numbers to account numbers but the accountnumbers gets replaced by NULL