Should be simple......

G

Guest

5 Fields
First, Middle, Maiden, Last, Suffix

I have managed to build an expression that would put all 5 fields together
with spaces. However, what I need is an expression that would "skip" a NULL
field, the trailing space and the comma if the Suffix field is NULL.

Here is what I have:
Expr1: TRIM([First]&" "&[Middle]&" "&[Maiden]&" "&[Last]&", "&[Suffix])

Any ideas out there?
 
D

DebbieG

Expr1: TRIM([First]&" "&[Middle]&" "&[Maiden]&" "&[Last]& (", "+[Suffix]) )

Not sure you need the TRIM.

HTH,
Debbie


message |5 Fields
| First, Middle, Maiden, Last, Suffix
|
| I have managed to build an expression that would put all 5 fields together
| with spaces. However, what I need is an expression that would "skip" a
NULL
| field, the trailing space and the comma if the Suffix field is NULL.
|
| Here is what I have:
| Expr1: TRIM([First]&" "&[Middle]&" "&[Maiden]&" "&[Last]&", "&[Suffix])
|
| Any ideas out there?
 
R

Rick B

You have to use an IF statement for each item. Something like...


Expr1: [First] & IIF([Middle]<>"",[Middle]&" ","") &...
 
D

DebbieG

Thought you might like to see how to code if Middle and Maiden are blank
also.

Expr1: TRIM([First] & (" "+[Middle]) & (" "+[Maiden]) & " " &[Last] & (",
"+[Suffix]) )

HTH,
Debbie


| Expr1: TRIM([First]&" "&[Middle]&" "&[Maiden]&" "&[Last]& (",
"+[Suffix]) )
|
| Not sure you need the TRIM.
|
| HTH,
| Debbie
|
|
in
| message ||5 Fields
|| First, Middle, Maiden, Last, Suffix
||
|| I have managed to build an expression that would put all 5 fields
together
|| with spaces. However, what I need is an expression that would "skip" a
| NULL
|| field, the trailing space and the comma if the Suffix field is NULL.
||
|| Here is what I have:
|| Expr1: TRIM([First]&" "&[Middle]&" "&[Maiden]&" "&[Last]&", "&[Suffix])
||
|| Any ideas out there?
|
|
 
G

Guest

Rick,

Thank you so much. Wish I had posted this question 2 hours ago.

B



Rick B said:
You have to use an IF statement for each item. Something like...


Expr1: [First] & IIF([Middle]<>"",[Middle]&" ","") &...




MSAccess_Fledgling said:
5 Fields
First, Middle, Maiden, Last, Suffix

I have managed to build an expression that would put all 5 fields together
with spaces. However, what I need is an expression that would "skip" a NULL
field, the trailing space and the comma if the Suffix field is NULL.

Here is what I have:
Expr1: TRIM([First]&" "&[Middle]&" "&[Maiden]&" "&[Last]&", "&[Suffix])

Any ideas out there?
 

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

Similar Threads

Query File As 6
blank fields on a name line 2
Splitting Text Field 1
Word Find & Replace 2
Separate Names 3
Trim trailing spaces for name field in query 4
Null fields in a calculated field 5
If / Then 3

Top