Ok, I have a table MFBRW
with a column SERV_CDE_LIST_OSI
This list is separated by a space; each code is 2 characters in length. The entire string can be 0 – 100
codes long.
ID | Active_Products__C | SERV_CDE_LIST_OSI
____________________________________________
1 | | AA AE AG
2 | | AA AG
3 | | AA AE LP
And I have another table AuthCodes
with columns AuthCode and ServiceName
ID | AuthCodes | ServiceName
__________________________________
1 | AA | Beer
2 | AE | Coffee
3 | AG | Coke
4 | LP | Water
I need to get the AuthCode.ServiceName
for each code in MFBRW.SERV_CDE_LIST_OSI
and write that name, as one long string @ MFBRW.Active_Products__C
ID | Active_Products__C | SERV_CDE_LIST_OSI
____________________________________________
1 | Beer; Coffee; Coke | AA AE AG
2 | Beer; Coke; | AA AG
3 | Beer; Coffee; Water;| AA AE LP
I thought this might work, but is does not return anything.
UPDATE Salesforce.[dbo].[MFBRW]
SET MFBRW.Active_Products__C = AuthCodes.ServiceName
FROM [MFBRW]
LEFT JOIN [AuthCodes]
ON [MFBRW].SERV_CDE_LIST_OSI = [AuthCodes].AuthCode
WHERE (((CharIndex(([MFBRW].[SERV_CDE_LIST_OSI]),([AuthCodes].[AuthCode])))>0));
Please assist.