Hi,
I fear this question may have already been answered under a thread titled "Parsing field into two fields', but here goes...
I have a similar situation, my data actually comes from a .csv spreadsheet exported from a routing program, looks like this:
BoxNumber
2R;34R
286
186W
230;237;411CCR
271WR
I can get it parsed out to individual box numbers, so:
BoxNumber
2R
34R
286
186W
230
237
411CCR
271WR
Next steps are to a) parse out the letter suffix (I've been using a Temp table with BoxNumber and Suffix fields); b) add leading zeros for sorting (e.g. 0002, 0034, etc); and c) re-concatenate the suffix, to wind up with something like this:
BoxNumber
0002R
0034R
0286R
0186W
0230
0237
0411CCR
0271WR
Some of the bumps in the road are: The box numbers can be 1-3 digits, with a suffix of 0-3 alpha characters, so; 2R, 18TW, 411CCR, etc.
The hitch is, I'm creating this database in Access 2013 to be deployed on a Sharepoint server, so vba isn't an option. I've been banging my head trying to figure out how to write the query sql to parse out the alpha suffixes using an instr() function. Is there some kind of wildcard option that can be used with an instr() that will find the end of the digits/beginning of alpha characters? Here's a few samples of the statements I've tried, with no success so far:
UPDATE tblSSNumPad SET tblSSNumPad.StopJobNumber = Left([StopJobNumber],InStr([StopJobNumber],"*[0-9]")), tblSSNumPad.Suffix = Right([StopJobNumber],InStr([StopJobNumber],"*[a-z]"));
UPDATE tblSSNumPad SET tblSSNumPad.StopJobNumber = Left([SStopJobNumber,InStr([SStopJobNumber,"*[!0-9]")-1), tblSSNumPad.Suffix = Right([SStopJobNumber,InStr([SStopJobNumber,"*[!0-9]"));
UPDATE tblSSNumPad SET tblSSNumPad.StopJobNumber = Left([StopJobNumber],InStr([StopJobNumber],"Like*[!0-9]")-1), tblSSNumPad.Suffix = Right([StopJobNumber],InStr([StopJobNumber],"Like*[!0-9]"));
UPDATE tblSSNumPad SET tblSSNumPad.StopJobNumber = Left([StopJobNumber],InStr([StopJobNumber],"*[#]")), tblSSNumPad.Suffix = Right([StopJobNumber],InStr([StopJobNumber],"*[#]+1"));
I must have tried 20+ combinations, can anyone help?
Thanks in advance,
Steve