Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IsNull Expression 2

Status
Not open for further replies.

Jimmy2128

Programmer
Feb 6, 2003
58
0
0
US
I have the following query

Full Name: [FNAME] & " " & [MNAME] & " " & [LNAME]+IIf(IsNull([DESIGN]),""," ," & [DESIGN])

I am getting the follwing:

John D. Doe ,PHD

I want to eliminate the space between Doe and the Comma.
It should read like = John D. Doe,PHD

Can please help me out. I tried every single thing and I cannot make to work.

Thanks

Jimmy
 
Simply replace this:
" ,"
With this:
","

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
that looks the same to me. Can you please revise it.. Thanks

Jimmy
 
Another handy trick to use in these kind of cases is "null propagation". You do this by using "+" instead of "&". The difference is:
(string1 + string2) = string1string2
(string1 + null string) = null
(string1 & null string) = string1

So lets say I have first name, middle initial, and last name:

firstname middleinitial lastname
John R Smith
Susan Brown (no initial)

firstname & " " & (middleinitial + ".") & " "& lastname
will give
John R. Smith
Susan Brown
 
firstname & " " & (middleinitial + ".") & " "& lastname

superb example, majp -- worth a star

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top