Link to home
Start Free TrialLog in
Avatar of robinski
robinski

asked on

Extract FirstName and Surname from Name

Greetings To All
============

First my apology - I've asked before, used the answer and now I've
lost it.

I have a field [FirstNameandSurname] in an imported table.

I need to store [FirstName] and [Surname] separately.

Your advice will be saved somewhere safe this time.

Many thanks,

Robinski
ASKER CERTIFIED SOLUTION
Avatar of paasky
paasky
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
LastName = SurName
Avatar of arcusd
arcusd

are there any characters that separates the two fields (ie. ",") ?
anyway the sql statement may look like this

Update MyTable set FirstName = Mid([FirstNameandSurname],1,8),
LastName = Mid([FirstNameandSurname],9,20)


....this assumes that the first 8 char is the first name and and the
rest is the surname
Avatar of robinski

ASKER

paasky's answer was correct, it worked and it was first.

Many thanks.

robinski
Happy to help you robinski.

Best regards,
Paasky