How do I concatenates two fields into one field in the same table?

S

sabow71

I have a single table in Access 2007 that includes basic contact information.
The first name and last name are separate fields. I need to create a "Full
Name" field in the same table that combines the first name and last name. I
have read many of the concatenation and query posts that cover this task but
they are not specific enough in explaining what I need to do.

I have created a query (as advised in other posts) and the Full Name field
(in the query) works perfectly. How do I now add that Full Name field in the
query to the table I am working with? When I try, I get the following error
message:

No valid fields can be found in 'Query'. You may have selected a query that
uses the table you're adding to the lookup column to. Please select a new
source.

What am I doing wrong? Please be specific in your replies/suggestions. While
I am skilled at programming, I am new to databases and Access 2007.
 
P

Pinacle

In the query design view..click on new column and type
FullName:[First Name]& " "&[Last Name]
Run the query.
 
K

Klatuu

There is absolutely no reason to store the full name in the table. In fact,
you should not. It violates at least two of the basic database normalization
rules. First, you should never store a value that can be calculated with
existing data and second, you are bloating the database by carrying redundant
data.

The correct method is to use the concatenation expression whenever you need
to show the full name on a form, a report, on in a query to export. It is
very simple. Here are examples using both SQL and the Query builder:

SQL:

SELECT [FirstName] & " " & [LastName] As FullName FROM...

Query Builder:

FullName: [FirstName] & " " & [LastName]
 
L

Larry Linson

sabow71 said:
I have a single table in Access 2007 that includes
basic contact information. The first name and last
name are separate fields. I need to create a "Full
Name" field in the same table that combines the
first name and last name.

Almost certainly you do not NEED to create a redundant field in the table --
that would be a violation of relational database normalization principles.
Almost certainly what you need to do is to create that
full-name-calculated-field in the Query that uses it... either as a Record
Source for a Form or Report, or whatever other uses you may put it to.

As you indicate you are already doing the latter, I won't go into detail.

Larry Linson
Microsoft Office Access MVP
 

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