iif statement returning syntax error

  • Thread starter Thread starter shelter
  • Start date Start date
S

shelter

This statement returns a syntax error, indicating I may have entered
an operand without an operator:

IIf([alteredchoice]="no", "Unaltered at Intake", IIf
([alteredchoice]="spayed" And [spayneuterbillingstatuschoice]="prior
to surrender", Altered at Intake", IIf
([alteredchoice]="neutered" And [spayneuterbillingstatuschoice]="prior
to surrender", Altered at Intake", IIf
([alteredchoice]="spayed" And [spayneuterbillingstatuschoice]<>"prior
to surrender", Unaltered at Intake", IIf
([alteredchoice]="neutered" And
[spayneuterbillingstatuschoice]<>"prior to surrender", Unaltered at
Intake","Altered status unknown)))))

I would appreciate any thoughts or solutions you may have.

Thanks.
DJ
 
This statement returns a syntax error, indicating I may have entered
an operand without an operator:

IIf([alteredchoice]="no", "Unaltered at Intake", IIf
([alteredchoice]="spayed" And [spayneuterbillingstatuschoice]="prior
to surrender", Altered at Intake", IIf
([alteredchoice]="neutered" And [spayneuterbillingstatuschoice]="prior
to surrender", Altered at Intake", IIf
([alteredchoice]="spayed" And [spayneuterbillingstatuschoice]<>"prior
to surrender", Unaltered at Intake", IIf
([alteredchoice]="neutered" And
[spayneuterbillingstatuschoice]<>"prior to surrender", Unaltered at
Intake","Altered status unknown)))))

I would appreciate any thoughts or solutions you may have.

Thanks.
DJ

I see your missing a bunch of quotes (as well as the opening = sign).
Fore example the * in the 3 examples below (there were more than these
3).

="prior to surrender", *Altered at Intake",

<>"prior to surrender", *Unaltered at Intake","Altered status
unknown*)))))

Try:
= IIf([alteredchoice]="no", "Unaltered at Intake", IIf
([alteredchoice]="spayed" And [spayneuterbillingstatuschoice]="prior
to surrender", "Altered at Intake", IIf([alteredchoice]="neutered"
And [spayneuterbillingstatuschoice]="prior
to surrender", "Altered at Intake", IIf([alteredchoice]="spayed" And
[spayneuterbillingstatuschoice]<>"prior to surrender", "Unaltered at
Intake", IIf([alteredchoice]="neutered" And
[spayneuterbillingstatuschoice]<>"prior to surrender", "Unaltered at
Intake","Altered status unknown")))))
 
This statement returns a syntax error, indicating I may have entered
an operand without an operator:
IIf([alteredchoice]="no", "Unaltered at Intake", IIf
([alteredchoice]="spayed" And [spayneuterbillingstatuschoice]="prior
to surrender", Altered at Intake", IIf
([alteredchoice]="neutered" And [spayneuterbillingstatuschoice]="prior
to surrender", Altered at Intake", IIf
([alteredchoice]="spayed" And [spayneuterbillingstatuschoice]<>"prior
to surrender", Unaltered at Intake", IIf
([alteredchoice]="neutered" And
[spayneuterbillingstatuschoice]<>"prior to surrender", Unaltered at
Intake","Altered status unknown)))))
I would appreciate any thoughts or solutions you may have.
Thanks.
DJ

I see your missing a bunch of quotes (as well as the opening = sign).
Fore example the * in the 3 examples below (there were more than these
3).

="prior to surrender", *Altered at Intake",

<>"prior to surrender", *Unaltered at Intake","Altered status
unknown*)))))

Try:
= IIf([alteredchoice]="no", "Unaltered at Intake", IIf
([alteredchoice]="spayed" And [spayneuterbillingstatuschoice]="prior
to surrender", "Altered at Intake", IIf([alteredchoice]="neutered"
And [spayneuterbillingstatuschoice]="prior
to surrender", "Altered at Intake", IIf([alteredchoice]="spayed" And
[spayneuterbillingstatuschoice]<>"prior to surrender", "Unaltered at
Intake", IIf([alteredchoice]="neutered" And
[spayneuterbillingstatuschoice]<>"prior to surrender", "Unaltered at
Intake","Altered status unknown")))))

Thank you for your time and response. I will post more after I test
this.
 
Back
Top