Need function to reverse LName, FName (1 Viewer)

Angel69

Registered User.
Local time
Today, 15:38
Joined
Jun 11, 2013
Messages
86
Hi,

I have a table with data that is imported from another application. The employee name is showing up as LName, FName. What function can I use to make these FName LName with no comma? I know I may have to do a two step to separate the two then concatanate but not sure how to do it. Thanks

UTA: I figured out LName: Trim(Left([ApprovedByFullName],InStr([ApprovedByFullName],",")-1)) to pull the last name minus the comma. How do I pull the first name?
 
Last edited:

Angel69

Registered User.
Local time
Today, 15:38
Joined
Jun 11, 2013
Messages
86
DIAZ, MARY
GOMEZ, LENNY
PARKS, LEE

Are some examples I need converted.
 

Brianwarnock

Retired
Local time
Today, 20:38
Joined
Jun 2, 2003
Messages
12,701
using instr to find the, you can use MID to extract the firstname, mid without a length extracts the data to the right of the start point.

Brian
 

MSAccessRookie

AWF VIP
Local time
Today, 15:38
Joined
May 2, 2008
Messages
3,428
Looks like you made a good start with the Last Name. In a similar manner, you can use the RIGHT() and InstrRev() Functions to get the First Name from the end of the String. Look at those two Functions and get back to us if you need any further assistance.

-- Rookie

UPDATE: Looks like Brian posted another alternative before I could post my reply. I am sure that either solution would work for you. Take a look at both of them so that you can understand their benefits.
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
I'm with Brian on this one.

However, it sounds like your database should already have the first name and last name parts in a table somewhere. If it doesn't then you might want to reconsider your table design.
 

Brianwarnock

Retired
Local time
Today, 20:38
Joined
Jun 2, 2003
Messages
12,701
Glad we could all help, and what I like is that you did not need it coding by us but did it yourself.

Brian
 

Users who are viewing this thread

Top Bottom