Query to display three names (1 Viewer)

Slim Shamble

Registered User.
Local time
Today, 22:47
Joined
Jun 3, 2016
Messages
29
Hi

I have 3 textboxs for first name, middle name and last name. And I want to display the names entered in this textbox. I try using this code below but its shows only the first and the last name.
Full name: IIF(IsNull([First Name],IIF([First Name]),[First Name]), IIF(IsNull([First Name]),[Last Name],[First Name] & " " & [Last Name]))

But this code only display just the first and last name. How do I get it to work also for middle name. That is to display First, Middle and Last Name.
 

Ranman256

Well-known member
Local time
Today, 17:47
Joined
Apr 9, 2015
Messages
4,337
select [FIRST] & " " & IIF(iSNULL([MIDDLE]),"", [MIDDLE] & " ") & [LAST] AS NAME FROM TABLE
 

Slim Shamble

Registered User.
Local time
Today, 22:47
Joined
Jun 3, 2016
Messages
29
Didn't work. Got an error saying

The syntax of the subquery in the expression is incorrect, check the subquery's syntax and enclose the subquery in parentheses. I don't understand that
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:47
Joined
May 7, 2009
Messages
19,245
its simple as this:

([First Name] + " ") & ([Middle Name] + " ") & [Last Name]
 

Users who are viewing this thread

Top Bottom