G
Guest
I am using Access 2005 and want to separate first and last name when they are
in the same column in a table. Thank you.
in the same column in a table. Thank you.
I am using Access 2005
and want to separate first and last name when they are
in the same column in a table. Thank you.
John Vinson said:I am using Access 2005
That's a good trick, since that version doesn't yet exist, if it ever
will!
and want to separate first and last name when they are
in the same column in a table. Thank you.
If (as you should) you want to permanently store these names in
LastName and FirstName fields in the table, you can use an Update
query. Assuming that you have names stored in the format
Firstname Lastname
you can add the two new fields to your table; then run an Update query
updating FirstName to
Left([fullname], InStr([fullname], " ") - 1)
and LastName to
Mid([fullname], InStr([fullname], " ") + 1)
YOu may then want to run a query searching LastName using the
criterion
LIKE "* *"
This will find instances where the person's first name contains a
blank, such as "Billy Bob" or "Robert A." or "Rhoda Mae" - the
"middle" name will have been incorrectly included in the LastName
field and will need to be manually corrected.
John W. Vinson[MVP]
pauld said:I saw this posting and hope you can help me with a simialr question
I have a field called SkipperName with a format of last, first.
I want to split it into FirstName and LastName.
How do I do this and get rid of the comma and space before the first name?
John Vinson said:I am using Access 2005
That's a good trick, since that version doesn't yet exist, if it ever
will!
and want to separate first and last name when they are
in the same column in a table. Thank you.
If (as you should) you want to permanently store these names in
LastName and FirstName fields in the table, you can use an Update
query. Assuming that you have names stored in the format
Firstname Lastname
you can add the two new fields to your table; then run an Update query
updating FirstName to
Left([fullname], InStr([fullname], " ") - 1)
and LastName to
Mid([fullname], InStr([fullname], " ") + 1)
YOu may then want to run a query searching LastName using the
criterion
LIKE "* *"
This will find instances where the person's first name contains a
blank, such as "Billy Bob" or "Robert A." or "Rhoda Mae" - the
"middle" name will have been incorrectly included in the LastName
field and will need to be manually corrected.
John W. Vinson[MVP]
pauld said:I saw this posting and hope you can help me with a simialr question
I have a field called SkipperName with a format of last, first.
I want to split it into FirstName and LastName.
How do I do this and get rid of the comma and space before the first name?
John Vinson said:I am using Access 2005
That's a good trick, since that version doesn't yet exist, if it ever
will!
and want to separate first and last name when they are
in the same column in a table. Thank you.
If (as you should) you want to permanently store these names in
LastName and FirstName fields in the table, you can use an Update
query. Assuming that you have names stored in the format
Firstname Lastname
you can add the two new fields to your table; then run an Update query
updating FirstName to
Left([fullname], InStr([fullname], " ") - 1)
and LastName to
Mid([fullname], InStr([fullname], " ") + 1)
YOu may then want to run a query searching LastName using the
criterion
LIKE "* *"
This will find instances where the person's first name contains a
blank, such as "Billy Bob" or "Robert A." or "Rhoda Mae" - the
"middle" name will have been incorrectly included in the LastName
field and will need to be manually corrected.
John W. Vinson[MVP]
I saw this posting and hope you can help me with a simialr question
I have a field called SkipperName with a format of last, first.
I want to split it into FirstName and LastName.
How do I do this and get rid of the comma and space before the first name?
Beetle said:Before you do anything, MAKE A BACKUP!
You would add LastName and FirstName fields to your table,
then as John suggested in that thread, you would use an Update
query but your calculated fields would look like;
LastName: Left([SkipperName], Instr([SkipperName], ",")-1)
FirstName: Mid([SkipperName], Instr([SkipperName], ",")+2)
The above assumes that the format for SkipperName is always
last name followed by a comma and space followed by first name.
Then you could delete the SkipperName field once you verify that
everything updates like you want.
__________
Sean Bailey
pauld said:I saw this posting and hope you can help me with a simialr question
I have a field called SkipperName with a format of last, first.
I want to split it into FirstName and LastName.
How do I do this and get rid of the comma and space before the first name?
John Vinson said:On Sun, 20 Mar 2005 15:29:01 -0800, "kiltnshirt"
I am using Access 2005
That's a good trick, since that version doesn't yet exist, if it ever
will!
and want to separate first and last name when they are
in the same column in a table. Thank you.
If (as you should) you want to permanently store these names in
LastName and FirstName fields in the table, you can use an Update
query. Assuming that you have names stored in the format
Firstname Lastname
you can add the two new fields to your table; then run an Update query
updating FirstName to
Left([fullname], InStr([fullname], " ") - 1)
and LastName to
Mid([fullname], InStr([fullname], " ") + 1)
YOu may then want to run a query searching LastName using the
criterion
LIKE "* *"
This will find instances where the person's first name contains a
blank, such as "Billy Bob" or "Robert A." or "Rhoda Mae" - the
"middle" name will have been incorrectly included in the LastName
field and will need to be manually corrected.
John W. Vinson[MVP]