IIF statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am stuck with the following Iif statement and would appreciate any
assistance:

=IIf([Suffix] Is Null,"([FirstName] & "" & " " & [LastName]",([FirstName] &
"" & " " & [LastName] & "" & ", " & [Suffix]))

Thanks in advance.
 
On Wed, 8 Aug 2007 20:40:01 -0700,
I am stuck with the following Iif statement and would appreciate any
assistance:

=IIf([Suffix] Is Null,"([FirstName] & "" & " " & [LastName]",([FirstName] &
"" & " " & [LastName] & "" & ", " & [Suffix]))

Thanks in advance.

Regarding & "" &
What is the purpose of this combination?

I assume you wish to print out the actual First Name and Last Name if
the [Suffix] field is null, not literally the string
"([FirstName] & "" & " " & [LastName]"

=IIf(IsNull([Suffix]),[FirstName] & " " & [LastName],[FirstName] &
" " & [LastName] & ", " & [Suffix])
 
Try:
= [FirstName] + " " & [LastName & ", " + [Suffix]

This uses a subtle difference between the + and & operators:
"A" & Null => "A"
"A" + Null => Null

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

"trilliums zjik discussions"
 
Back
Top