Solved

Extract FirstName and Surname from Name

Posted on 2000-04-11
5
434 Views
Last Modified: 2008-03-06
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
0
Comment
Question by:robinski
  • 3
5 Comments
 
LVL 10

Accepted Solution

by:
paasky earned 50 total points
ID: 2706613
Hello robinski,

UPDATE table1
SET FirstName = Left([FullName],Instr(1,[FullName]," ")-1),
    LastName = Mid([FullName],Instr(1,[FullName]," ")+1);

Regards,
Paasky
0
 
LVL 10

Expert Comment

by:paasky
ID: 2706616
LastName = SurName
0
 
LVL 4

Expert Comment

by:arcusd
ID: 2706617
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
0
 

Author Comment

by:robinski
ID: 2706645
paasky's answer was correct, it worked and it was first.

Many thanks.

robinski
0
 
LVL 10

Expert Comment

by:paasky
ID: 2706655
Happy to help you robinski.

Best regards,
Paasky
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now