Concatenate

B

Bdavis

I must be blind or have a bad memory but, I could have
sworn that you could concatenate two fields in an
expression of a query. However, Concatenate does not seem
to be a function in Access. Am I missing something?

-Ben
 
J

John Vinson

I must be blind or have a bad memory but, I could have
sworn that you could concatenate two fields in an
expression of a query. However, Concatenate does not seem
to be a function in Access. Am I missing something?

-Ben

The & operator and the + operator (with Text fields) both concatenate
values. They are subtly different: [FieldA] & [FieldB] will treat a
NULL value in either field as an empty string, returning just the
non-NULL field; [FieldA] + [FieldB] will return NULL if either field
is NULL. This can be handy in an expression like

[FirstName] & (" " + [MiddleName]) & " " & [LastName]

to suppress the extra blank if there is a NULL middle name.
 

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