Concatenate two fields into one

L

Lori

How can I update a field in a table by concatenating the
values of two other fields. I have a First Name and a
Last Name field and would like to put these values into a
new field with a space in between, for example Joe Smith.
What is the syntax for this in an update query? Thanks!
 
G

Guest

Try this Update query:

UPDATE Table1
SET [Full Name] = [First Name] & " " & [Last Name]
 
L

Lynn Trapp

Lori,
There is no need to store the information in your table. Simple query the
data when you need it.

SELECT [First Name] & " " & [Last Name]
FROM YourTable;

One other thing. You should be careful about putting spaces in your field
names. It requires you to put square brackets [ ] around the field names
and might cause problems later.
 
L

Lynn Trapp

As I indicated in my response, this is an unnecessary process because it is
always possible to concatenate the first and last names on the fly in a
query -- something that will be much faster than trying to retrieve the Full
Name data from the disk.

Also, consider the scenario in which one of the people in the table is Jane
Smith. Jane gets married and becomes Jane Jones. There is no automatic
update to the Full Name field and no way to automatically detect it. Thus,
rather than continually running updates to make sure the full name is
accurate, it is simply better to do it on the fly in a query.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Try this Update query:

UPDATE Table1
SET [Full Name] = [First Name] & " " & [Last Name]
How can I update a field in a table by concatenating the
values of two other fields. I have a First Name and a
Last Name field and would like to put these values into a
new field with a space in between, for example Joe Smith.
What is the syntax for this in an update query? Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top