L lhooker Registered User. Local time Yesterday, 21:44 Joined Dec 30, 2005 Messages 431 Apr 15, 2018 #1 Why is no 'Actual_Name' given when no 'Middle_Name' is provided in a select query ? Below is the syntax of the statement. Actual_Name: [First_Name]+" "+[Middle_Name]+" "+[Last_Name] :banghead:
Why is no 'Actual_Name' given when no 'Middle_Name' is provided in a select query ? Below is the syntax of the statement. Actual_Name: [First_Name]+" "+[Middle_Name]+" "+[Last_Name] :banghead:
BigHappyDaddy Coding Monkey Wanna-Be Local time Yesterday, 18:44 Joined Aug 22, 2012 Messages 205 Apr 15, 2018 #2 What is your complete SQL statement? What is your actual results? What is your expected results?
isladogs Access MVP / VIP Local time Today, 02:44 Joined Jan 14, 2017 Messages 19,383 Apr 15, 2018 #3 Try this instead: Code: Actual_Name: [First_Name] & IIf(Nz([Middle_Name],"")<>""," " & [Middle_Name] & " "," ") & [Last_Name] Notice I've replaced + separator with & Also modified the handling of spaces around the middle name so you don't get two spaces if no middle name exists
Try this instead: Code: Actual_Name: [First_Name] & IIf(Nz([Middle_Name],"")<>""," " & [Middle_Name] & " "," ") & [Last_Name] Notice I've replaced + separator with & Also modified the handling of spaces around the middle name so you don't get two spaces if no middle name exists
arnelgp ..forever waiting... waiting for jellybean! Local time Today, 10:44 Joined May 7, 2009 Messages 20,746 Apr 15, 2018 #4 Because it propagate the null when you use +, instead: Actual_Name: ([First_Name] + " ") & ( [Middle_Name]) + " ") & [Last_Name]
Because it propagate the null when you use +, instead: Actual_Name: ([First_Name] + " ") & ( [Middle_Name]) + " ") & [Last_Name]
L lhooker Registered User. Local time Yesterday, 21:44 Joined Dec 30, 2005 Messages 431 Apr 16, 2018 #5 BigHappyDaddy/Ridders/Arnelgp/Pat Hartman, Thanks to all ! ! ! I used Arnelgp's solution.