stringing names from a field

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I have a field in table that displays an employees name as
follows
Stan M Smith. I need to reformatt the data so that I can
pull Smith, M Stan. Since they are names I can't use a
typical sting to break out the name in phases - anyone
have a idea?
thanks
s
 
Hi Scott

if all your names are in the same structure (first / middle initial /
surname) you can use these statements in a query to split them up - and its
a good idea to store them "split up"
firstname: Left([fullname],InStr([fullname]," ")-1)
middleinitial: Mid([fullname],InStr([fullname]," ")+1,1)
lastname: Right([fullname],Len([fullname])-InStr(1,[fullname]," ")-2)

once they're in three separate fields you can always put them back together
fullname: lastname & ", " & middleinitial & " " & firstname
will give you them in the output that you want

Hope this helps
Cheers
JulieD
 
Back
Top