?
Solved

Extract FirstName and Surname from Name

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

850 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