Combining Fields

R

RoadKill

This is a stupid question, but I just can't seem to remember how to do it. I
want to combine the two fields of 'FirstName' & 'LastName' in one field named
'EmployeeName'. When I do it, it doesn't put a space in the name so it looks
like 'JohnDoe'. How do I get the space in between John and Doe? My sql is
below:

SELECT [FirstName]+[Las Name] AS EmployeeName
FROM [EMPLOYEEINFO];
 
K

Ken Snell \(MVP\)

SELECT [FirstName] + ' ' + [Las Name] AS EmployeeName
FROM [EMPLOYEEINFO];
 
R

RoadKill

I knew it was simple. Thanks much.

Ken Snell (MVP) said:
SELECT [FirstName] + ' ' + [Las Name] AS EmployeeName
FROM [EMPLOYEEINFO];

--

Ken Snell
<MS ACCESS MVP>


RoadKill said:
This is a stupid question, but I just can't seem to remember how to do it.
I
want to combine the two fields of 'FirstName' & 'LastName' in one field
named
'EmployeeName'. When I do it, it doesn't put a space in the name so it
looks
like 'JohnDoe'. How do I get the space in between John and Doe? My sql is
below:

SELECT [FirstName]+[Las Name] AS EmployeeName
FROM [EMPLOYEEINFO];
 
S

Student Databaser

I want to do this same thing, but have it automatically populate the Employee
field when last name and first name are entered in - not as a query, but in
the table.

Is this popssible? The reason for doing so is to be able to look up a
client by their whole name, not just first or last.

Thanks!

Ken Snell (MVP) said:
SELECT [FirstName] + ' ' + [Las Name] AS EmployeeName
FROM [EMPLOYEEINFO];

--

Ken Snell
<MS ACCESS MVP>


RoadKill said:
This is a stupid question, but I just can't seem to remember how to do it.
I
want to combine the two fields of 'FirstName' & 'LastName' in one field
named
'EmployeeName'. When I do it, it doesn't put a space in the name so it
looks
like 'JohnDoe'. How do I get the space in between John and Doe? My sql is
below:

SELECT [FirstName]+[Las Name] AS EmployeeName
FROM [EMPLOYEEINFO];
 
B

Bob Barrows [MVP]

I know this seems like a good idea to you but it's not. Storing the
results of the calculation forces someone to repeat the calculation
whenever one of the operands changes.

You will get more efficient results by indexing the last and first name
fields, and searching both of them for the names you want:

where lastname = [enter last name] and firstname = [enter first name]


Student said:
I want to do this same thing, but have it automatically populate the
Employee field when last name and first name are entered in - not as
a query, but in the table.

Is this popssible? The reason for doing so is to be able to look up a
client by their whole name, not just first or last.

Thanks!

Ken Snell (MVP) said:
SELECT [FirstName] + ' ' + [Las Name] AS EmployeeName
FROM [EMPLOYEEINFO];

--

Ken Snell
<MS ACCESS MVP>


RoadKill said:
This is a stupid question, but I just can't seem to remember how to
do it. I
want to combine the two fields of 'FirstName' & 'LastName' in one
field named
'EmployeeName'. When I do it, it doesn't put a space in the name so
it looks
like 'JohnDoe'. How do I get the space in between John and Doe? My
sql is below:

SELECT [FirstName]+[Las Name] AS EmployeeName
FROM [EMPLOYEEINFO];
 

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