Simple Concatenation Query

G

Guest

I have a query to combine First Middle and Last name:
FullName: Table!First+" "+Table!Middle+" "+Table!Last.

This works if someone has all 3 (First, Middle and Last) names, BUT WONT
display any name at all If someone doesnt have a middle initial. For these
people, i would like it to show a First and Last name only.

Thank you!
 
G

Guest

Try this --

FullName:
.[First]+IIF(
.[Middle] Is Null,"","
"+
.[Middle]) +" "+
.[Last]
 
G

Guest

Works perfectly. Thank you.

KARL DEWEY said:
Try this --

FullName:
.[First]+IIF(
.[Middle] Is Null,"","
"+
.[Middle]) +" "+
.[Last]


kayabob said:
I have a query to combine First Middle and Last name:
FullName: Table!First+" "+Table!Middle+" "+Table!Last.

This works if someone has all 3 (First, Middle and Last) names, BUT WONT
display any name at all If someone doesnt have a middle initial. For these
people, i would like it to show a First and Last name only.

Thank you!
 
B

Brian Bastl

You may also try the following, which (according to my tests) will keep the
text left-aligned and properly spaced regardless of which field(s) may be
empty.

MoneyBags: Trim((PerFirst+" ") & ( PerMiddle + " ") & (PerLast))

HTH,
Brian

kayabob said:
Works perfectly. Thank you.

KARL DEWEY said:
Try this --

FullName:
.[First]+IIF(
.[Middle] Is Null,"","
"+
.[Middle]) +" "+
.[Last]


kayabob said:
I have a query to combine First Middle and Last name:
FullName: Table!First+" "+Table!Middle+" "+Table!Last.

This works if someone has all 3 (First, Middle and Last) names, BUT WONT
display any name at all If someone doesnt have a middle initial. For these
people, i would like it to show a First and Last name only.

Thank you!
 

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