Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Concatenation problem

    I am trying to concatenate NameHusband, NameWife, and LastName, where either the husband´s or the wife´s name may be missing. I am OK with a missing wife´s name by using the + symbol rather than the &, but when I throw in the possible missing husband´s name, I can´t get things to work.

    Can somebody help?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,537
    Thanks
    0
    Thanked 23 Times in 23 Posts
    please explain this in moredetail.
    Are you using NameHusband + NameWife + LastName?

  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes. Here is where I am now.

    Expr1: [tblColonMst]![FstNameHus] & (" y "+[tblColonMst]![FstNameWfe]) & " " & [tblColonMst]![LastName1]

    If I have no FstNameHus, I get the "y" in front of FstNameWfe. If I have no FstNameWfe, it works.

    Thanks for the attention.

  4. #4
    New Lounger
    Join Date
    Sep 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this:

    [tblColonMst]![FstNameHus] & (IIF(Nz([tblColonMst]![FstNameHus])="",""," y ")+[tblColonMst]![FstNameWfe]) & " " & [tblColonMst]![LastName1]

    This adds the " y " only if the FstNameHus is not blank. It should work even if your fields allow zero-length strings.
    Last edited by Mike J; 2013-06-06 at 14:22. Reason: I realized my first answer was wrong.

  5. #5
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you.

    Do you guys realize how much you help?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •