I have two tables one table is called BuyerGuideCodes and the other is called BuyerGuideCodesDescriptions.
Below is a sample record of table BuyerGuideCodes:
ID:
1
COMPANY:
CJ Systems Aviation Group
CodeID:
SS, OP, AS, AL, AN, AO, BS, GA, HD, IT, RO, PS, TR, MK
The table BuyerGuideCodesDescriptions has a description for each value in the CodeID field for table BuyerGuideCodes.
Sample data from BuyerGuideCodesDescriptions:
ID CodeID CodeDescription
42 SS Air Medical Support Services
I need the field CodeID in BuyerGuideCodes to be broken out and decyphered based on the information from table BuyerGuideCodesDescriptions.
I have the following query written but I have to create muliple fields and then repeat the query to many times. There has got to be an easier way. HELP!
UPDATE BuyerGuideCodes SET CodeDescription14 = MID(CodeDescription14,1,INSTR(1,CodeDescription14,", ")), CodeDescription15 = MID(CodeDescription14,INSTR(1,CodeDescription14, ", ")+1)
WHERE INSTR(1,CodeDescription14,", ");
Below is a sample record of table BuyerGuideCodes:
ID:
1
COMPANY:
CJ Systems Aviation Group
CodeID:
SS, OP, AS, AL, AN, AO, BS, GA, HD, IT, RO, PS, TR, MK
The table BuyerGuideCodesDescriptions has a description for each value in the CodeID field for table BuyerGuideCodes.
Sample data from BuyerGuideCodesDescriptions:
ID CodeID CodeDescription
42 SS Air Medical Support Services
I need the field CodeID in BuyerGuideCodes to be broken out and decyphered based on the information from table BuyerGuideCodesDescriptions.
I have the following query written but I have to create muliple fields and then repeat the query to many times. There has got to be an easier way. HELP!
UPDATE BuyerGuideCodes SET CodeDescription14 = MID(CodeDescription14,1,INSTR(1,CodeDescription14,", ")), CodeDescription15 = MID(CodeDescription14,INSTR(1,CodeDescription14, ", ")+1)
WHERE INSTR(1,CodeDescription14,", ");