Jump to content

1 Table 6 fields - concatenate into 3 sets, compare and replace where match


OldWest

Recommended Posts

Although I am deciding on the best route to go on this, I was hoping for any feedback or ideas on the best and simplest approach to the below problem:

 

 

Here is my table structure:

 

old_code_1

old_code_2

 

new_code_1

new_code_2

 

prod_code_1

prod_code_2

 

Each of the following fields has 5 digits e.g. 00045, 12654, etc.

 

What I need to achieve is this:

 

Concatenate each set (of the 3 sets above) data into one variable e.g. old_code_1 + old_code_2 = 0004512654. So old_code_1 & old_code_2 would become a combined data and the same for the othe 2 sets.

 

Then. Once concatenated, I need to compare: prod_code_1+prod_code_2 with old_code_1+old_code_2 and replace prod_code_1+prod_code_2 with new_code_1+new_code_2 where matches are found.

 

The new_code_1 & 2 are in the same row as the old_code 1 & 2. So the data is in alignment that way for comparison.

 

Thanks for any insight or suggestions on how to make this happen in the simplest form possible.

I should note I do not need the Concatenate to output any new data. I just need it Concatenated in an array or the likes for processing, so the prod_codes can be updated in their respective fields.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.