how do i strip out the first 5 characters in a field?

  • Thread starter Thread starter nhderting
  • Start date Start date
N

nhderting

I have a 255 character text field with data of varying actual length in it.
The first part of the data is all structured the same and I need to parse it
out effectively into 3 separate fields. Data is like: XXX, YYY,
thenbunchofothernonsenseupto255chars.

I apologize if this is entry level question -- I am just a rookie with a
problem I have to solve. I've used the left function to create the first of
the new fields, but that's as far as I can go without help.

I appreciate any/all help you are willing to provide.

Thanks,
Theresa
 
You can attack this in one of two ways. Here's what I consider the less
complex.

In addition to the Left() function, you have available to you the Mid()
function which allows you to select a string of "X" characters length
starting at a position you specify.

If your first string is Left(YourHumungoField, 3)
then the second string might be Mid(YourHumngoField, 5,3)

I am assuming here that the sample you posted is the exact layout, with a ,
and a space between the XXX's and the YYY's.

There is also a Right() Function that would allow you to parse off the
thenbunchofothernonsenseupto255chars
It would be Right(YourHumungoField, 255-10)
 
Thanks, George, I'm going to try this now! I'll let you know how I fare. I
can't tell you how much I appreciate the guiding hand.

Theresa
 
You can also use MID for the third part. MID's second parameter is the
starting position and the third parameter is the length. If you omit the
third parameter MID will return a string starting at the starting position
and going to the end of the string.

John... Visio MVP
 
Back
Top