I have a data field that is 20-character string called [Veh_Impact]. Each character in the string starts off by default as a zero. "00000000000000000000"
Each of these characters happens to stand for a particular location on a car body. A zero in a given position means that part of the car is not damaged, a 1 means light damage, a 2 means moderate and a 3 means severe damage.
So a string for a car that has been in an accident might look like this: "00000123300000000222"
We get data from the state of Louisiana that has a whole different coding system. A "G" for example corresponds to damage at positions 5 and 6. And another field will indicate the extent of that damage. They can have several such sets for a given vehicle.
So I run this through a converter and end up with three pieces of information for each set of damage codes which has a location, which in the example would be 5, a length which would be 2 (i.e. 5 and 6) and the damage level, which we'll say was something equivalent to our damage level 3.
So, with this bit of data I want to change the default string to "00003300000000000000". Then with any additional set of codes they provided I'd continue to update the string.
The problem is I can't figure out a function that does this. Essentially I want to say:
With the string [Veh_Impact] ("00000000000000000000"), begin at position 5 and replace the next 2 characters with 3's.
I envision something like the MID function, but one that takes an action rather than just querying, like if you could say MID([Veh_Impact],5,2)="33"
How would one do something like this?