Solved

Extract FirstName and Surname from Name

Posted on 2000-04-11
5
439 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

691 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