Union with IIF ??

C

CJ

Good Day

I am trying to use an IIF statement in a union query but I keep getting the
error message "Syntax error, missing operator......"

The union query works fine if I don't have this IIF statement so could
somebody please help me out with it??

SELECT IIf(Not IsNull([strAltLast]) ,[strLast] & ", " & [strFirst] & " and "
& [strAltLast] & ", " & [strAltFirst], IIf(Not IsNull([strAltFirst])
,[strLast] &", "& [strFirst] & " and " & [strAltFirst], [strLast] & ", " &
[strFirst] AS VoterMember, ...... continues from there......

I am trying to test to see if there is an alternate contact person and
whether or not that contact person has a different last name than my primary
contact.

So basically I am looking for this kind of thing:

Smith, Jim and Adams, Mary (alternate contact with different last name)
OR
Smith, Jim and Mary (alternate contact, same last name) OR
Smith, Jim (individual)

Thanks in Advance
CJ
 
G

Guest

I think your missing a closing bracket before the AS Votemember for your
second IIF and then a comma and an else part and another closing bracket for
your first IIF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top