[AccessD] IFF else problem

KathrynAtGwens kathrynatgwens at socal.rr.com
Mon Aug 16 13:07:18 CDT 2004


in query, I have an existing 
Expr1: [FirstName] & " " & [Surname] & " " & [MarrName]

I have a field called Female that can be True or False.

What I want is that IF [Female] is true, then I want:
FirstName (Surname) MarrName
Jane (Smith) Doe

otherwise (if Female is False) then I want
FirstName Surname
John Doe

Based on my previously giving Drew a slightly different scenario of having the married name last in parens, like
Jane Smith (Doe), he gave me this (though I've modified [Sex] being F to [Female] being True)
IFF([Female]="True",IIF(Len([MarrName])>0),"(" & [MarrName] & ")",""),"")

But no matter how I try to combine everything in the query, I can't get my results correct. I've either got too many of this, or not enough of that or undefined functions

I know I can leave out the length portion because that is no longer needed since I want the () around the surname of females, and surname is always filled in. Here is my most recent attempt without regards to the males:

Expr1: IFF([Female]="True", [FirstName] & "(" & [Surname] & ")" & [MarrName])
which does not give me any invalid syntax errors, but does give me Undefined Function IIF in expression. I assume that has something to do with defining the "else" portion.

So, what do I need to add? 

--
Kathryn Bassett (at work address)
kathrynatgwens at socal.rr.com
kathryn at bassett.net (home) 




More information about the AccessD mailing list