MS Access 2007: Concatenate first name and last name fields with a space in the middle
This MSAccess tutorial explains how to create a query to concatenate the first name and last name fields together separated by a space in Access 2007 (with screenshots and step-by-step instructions).
This MSAccess tutorial explains how to concatenate first name and last name fields with a space in the middle in
Question: In Microsoft Access 2007, how can I concatenate the first name and last name fields with a space in the middle?
For Example, if you had the following fields:
FirstName | LastName |
---|---|
Steve | Anderson |
So if the FirstName is Steve and the LastName is Anderson, I'd like to display "Steve Anderson" in a query not "SteveAnderson". How can I concatenate the two fields with a space in the middle?
Answer: In the example below, we've created a field in our query that is comprised of the FirstName field from the Employees table, then a single space, and then the LastName field from the Employees table.
We've opened our query in Design View by right-clicking on the Query in the left window and selecting Design View in the popup menu. Then we've entered the following:
[FirstName] & " " & [LastName]
Access will automatically assigned a name for this field in the result set. In this example, it has named the new field Expr1.
You will probably want to overwrite the name from Expr1 to something more meaningful. We've renamed the field to Name as seen in the picture below.
Now when you run this query, your results should look as follows:
As you can see, the concatenated field that we called Name now displays the Employee name with a space separating the first and last name values.
Advertisements