I'm trying to use embedded IIF Statement in a query (first time using it) and I keep getting the error "expression you entered is missing a closing parenthesis,bracket or vertical bar". The first 2 IIF statements work great but when I add the last two - I get the error.
Can anyone tell me what's wrong??
RStatall: IIf([RStatus] Is Null And [EecDateOfTermination] Is Null And [SumOfRPAY]>=0 Or [RStatus] Is Not Null And [EecDateOfTermination] Is Null And [SumOfRPAY]>=0 Or [RStatus] Is Null And [EecDateOfTermination]>[YREND] And [SumOfRPAY]>=0 Or [RStatus] Is Not Null And [EecDateOfTermination]>[YREND] And [SumOfRPAY]>=0,2,IIf([EecDateOfTermination] Between [YRBEG] And [YREND] And [RVesting Svc]<5 And [SumOfRPAY]>=0 Or [EecDateOfTermination] Between [YRBEG] And [YREND] And [RVesting Svc] Is Null And [SumOfRPAY]>=0,12,IIf([EecDateOfTermination] Between [YRBEG] And [YREND] And [RVesting Svc]>=5 And [SumOfRPAY]>=0,11, IIf([EecPayGroup]="RETIRE" And [SumOfRPAY]>=0,14))
Can anyone tell me what's wrong??
RStatall: IIf([RStatus] Is Null And [EecDateOfTermination] Is Null And [SumOfRPAY]>=0 Or [RStatus] Is Not Null And [EecDateOfTermination] Is Null And [SumOfRPAY]>=0 Or [RStatus] Is Null And [EecDateOfTermination]>[YREND] And [SumOfRPAY]>=0 Or [RStatus] Is Not Null And [EecDateOfTermination]>[YREND] And [SumOfRPAY]>=0,2,IIf([EecDateOfTermination] Between [YRBEG] And [YREND] And [RVesting Svc]<5 And [SumOfRPAY]>=0 Or [EecDateOfTermination] Between [YRBEG] And [YREND] And [RVesting Svc] Is Null And [SumOfRPAY]>=0,12,IIf([EecDateOfTermination] Between [YRBEG] And [YREND] And [RVesting Svc]>=5 And [SumOfRPAY]>=0,11, IIf([EecPayGroup]="RETIRE" And [SumOfRPAY]>=0,14))