Regular Expression Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a question that I know can be solved using this function, I just don't
know much about Regular Expressions. Please Help.

I have a "Name" field that has a person's name. Ex. "Smith, John"

I want to split that out into a Lastname Field and a Firstname Field.
Obviously I can't use Left or Right functions since the size of the name
varies.

Can someone please help? Thanks!
 
I have a question that I know can be solved using this function, I just don't
know much about Regular Expressions. Please Help.

I have a "Name" field that has a person's name. Ex. "Smith, John"

I want to split that out into a Lastname Field and a Firstname Field.
Obviously I can't use Left or Right functions since the size of the name
varies.

Can someone please help? Thanks!

As long as all of the recods are in the same exact format, i.e.
Last Name comma space First Name:
LastName = Left([FullName],Instr([FullName],",")-1)
Firstname = Mid([FullName],Instr([FullName],",")+2)
 
Oh man, I'm an idiot. Thanks a bunch, that worked perfect.

fredg said:
I have a question that I know can be solved using this function, I just don't
know much about Regular Expressions. Please Help.

I have a "Name" field that has a person's name. Ex. "Smith, John"

I want to split that out into a Lastname Field and a Firstname Field.
Obviously I can't use Left or Right functions since the size of the name
varies.

Can someone please help? Thanks!

As long as all of the recods are in the same exact format, i.e.
Last Name comma space First Name:
LastName = Left([FullName],Instr([FullName],",")-1)
Firstname = Mid([FullName],Instr([FullName],",")+2)
 
Back
Top