Re: Separating People



One more example "Carla de los Sotos"


By the way, here is a previous post that answers how to do this. It is from
"Sprinks" who posts some great responses in the groups!

--------------------------------------

If they are separated by a space, as in "John Smith", add two new fields to
your table, e.g., FName and LName, and use an update query to parse the name
into the two fields, using the Left, Right, and InStr functions. For an
initial field named "StudentName", the SQL is:

UPDATE Students SET Students.FName =
Left([StudentName],InStr([StudentName]," ")-1), Students.LName =
Right([StudentName],Len([StudentName])-InStr([StudentName]," "));

See VBA Help for more information on the string functions.

Hope that helps.
Sprinks



"Brian" <btmink@xxxxxxxxxxxx> wrote in message
news:mr2dg.2$gC.0@xxxxxxxxxxxxxxxxxxxxxxxxxxx
I have been given a new requirement for a database that I have been using
for a long time. I have a Name field that needs to show as FirstName and
LastName for one report. I am having a hard time figuring out how to modify
the query so that it only calls up the first or last names. I can see how
to select a certain character length, but until we can convince everyone to
have names of the same length, I can't see that helping. The names are all
stored with first name, a space, then last name.

Any help would be appreciated.

Thanks,

Brian



.



Relevant Pages

  • Re: Separating People
    ... into the two fields, using the Left, Right, and InStr functions. ... UPDATE Students SET Students.FName = ... See VBA Help for more information on the string functions. ... I am having a hard time figuring out how to ...
    (microsoft.public.access.queries)
  • Re: Separating People
    ... Maria de los Sotos would become Maria and Sotos. ... UPDATE Students SET Students.FName = ... See VBA Help for more information on the string functions. ... I am having a hard time figuring out how to ...
    (microsoft.public.access.queries)
  • Re: Break Apart Text
    ... diffrent text box. ... 1256 1/2 South Los Angeles Street, Apt. ... function or the Left, Mid, Right, and Instr functions with any ... Look them all up in VBA help. ...
    (microsoft.public.access.modulesdaovba)

Loading