Extract middle of field

  • Thread starter Thread starter Robert Gillard
  • Start date Start date
R

Robert Gillard

I have a field (that is imported) containing peoples name and work area (as
below). I would like to be able to strip out their first name. Naturally
everybody's names are of a different length, how is it possible to extract
just the first name from the middle of the field.

Brown, Pete : Enable
Ashbery, Andy : Shop
Boughey, Frank : Desk


Bob
 
In a query?

FirstNameField:Mid([CombinedNames],InStr([CombinedNames],",")+2,InStr([Combi
nedNames],":")-2-InStr([CombinedNames],",")-1)
 
Sorry....I didn't see the extra text at the end of the field's value.

Go with Fred's more complete answer!

--
Ken Snell
<MS ACCESS MVP>


Ken Snell said:
Mid([PersonName], InStr([PersonName], ", ") + 2)

--
Ken Snell
<MS ACCESS MVP>

Robert Gillard said:
I have a field (that is imported) containing peoples name and work area (as
below). I would like to be able to strip out their first name. Naturally
everybody's names are of a different length, how is it possible to extract
just the first name from the middle of the field.

Brown, Pete : Enable
Ashbery, Andy : Shop
Boughey, Frank : Desk


Bob
 
Back
Top