Update Query

B

Brianna W

I have a table in which I would like to combine two fields. The fields are
LastName and FirstName. I would like to create a new field called FullName
that would have LastName (space) FirstName.

How can I trunkate the data copied from LastName and FirstName fields during
the update so that no extra spaces are included in the new FullName field?

Thanks in advance for any assisatance.
 
G

Guest

Hi Brianna W

I always use the following method to join two name fields.

FullName: [TableName]![FirstName] & ' ' & [TableName]![LastName]

Providing there is data within both fields you are joining this should work
fine!

Hope this helps.

Regards

Simon
 
S

SteveS

Brianna said:
I have a table in which I would like to combine two fields. The fields are
LastName and FirstName. I would like to create a new field called FullName
that would have LastName (space) FirstName.

How can I trunkate the data copied from LastName and FirstName fields during
the update so that no extra spaces are included in the new FullName field?

Thanks in advance for any assisatance.

Brianna,

It's not a good idea to create a field "FullName" in your table since you can
always calculate it "on the fly" in a query or in code.

In a query -
FullName: Trim([LastName]) & ", " & Trim([FirstName])


Also:
If a name is misspelled, you now have two places to correct it.
It violates the 2nd normal form (I think) of normalization.
 

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