?
Solved

Extract FirstName and Surname from Name

Posted on 2000-04-11
5
Medium Priority
?
441 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 200 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

771 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