Dear Friends,
This newbie has been struggling for days trying to create a concatenation query utilizing the IIF function.
My data are 68-year-old high school graduates. The fields involved are: GOESBY, LNAME, and MARRIEDNAME (lname is lastname). I am attempting to create a field called: NAMETODAY.
Each field contains one name element. I made MarriedName a required field and entered a space in each blank field, thus creating a null field.
The query affects females in the class, as men generally keep the name they had at birth.
Gender Goesby LName MarriedName NameToday F Penny McMaker Baker Penny Baker F Reesa Rainmaker Reesa Rainmaker M Fred Freeloader Fred Freeloader
· Penny married Tom Baker in a lovely wedding and is now known as Penny Baker.
· Reesa never married and has remained Reesa Rainmaker.
· It matters not what Fred did in the matrimonial department; as a male he will continue to use Freeloader as his last name.
So, my query needs to take the first name, then evaluate the married name. If married name is populated, use that data. If it is null, use the last name data.
This is my query. The error keeps say parenthesis, vertical bar, etc. is out of place. I know it is a simple fix. I just can’t find it.!
NameToday: [1- Names]![GoesBy] &" " & IIf([1- Names]![MarriedName]="Null",[1- Names]![Lname])
PS: as a newbie, I can’t do codes. And thanks to all of you for your kindly help….