My query doens't work after the 13th IIf statement and gives me this message:
"The expression you entered exceeds the 1,024-character limit for the query design grid".
How can I resolve this issue?
Thanks,
SELECT IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*MV*","MV 30 Days Prior To Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*RH*","RH 30 Days Prior To Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*RE*","RE At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*CE*","CE At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*AG*","AG At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*AC*","AC At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*RX*","RX At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*RE*","RE 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*CE*","CE 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*AG*","AG 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*AC*","AC 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*RX*","RX 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*MV*","MV 30 Days After Expire",
""))))))))))))) AS ["KeyCodeList"], qryJOE_REPORT_2.Subscription_Def, qryJOE_REPORT_2.MaxOfEffortLevel, qryJOE_REPORT_2.Customer_ID, qryJOE_REPORT_2.CallResult, qryJOE_REPORT_2.RepName
FROM qryJOE_REPORT_2;
"The expression you entered exceeds the 1,024-character limit for the query design grid".
How can I resolve this issue?
Thanks,
SELECT IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*MV*","MV 30 Days Prior To Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*RH*","RH 30 Days Prior To Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*RE*","RE At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*CE*","CE At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*AG*","AG At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*AC*","AC At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="4" And [qryJOE_REPORT_2.subscription_def] Like "*RX*","RX At Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*RE*","RE 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*CE*","CE 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*AG*","AG 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*AC*","AC 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*RX*","RX 30 Days After Expire",
IIf([qryJOE_REPORT_2.MaxOfEffortLevel]="5" And [qryJOE_REPORT_2.subscription_def] Like "*MV*","MV 30 Days After Expire",
""))))))))))))) AS ["KeyCodeList"], qryJOE_REPORT_2.Subscription_Def, qryJOE_REPORT_2.MaxOfEffortLevel, qryJOE_REPORT_2.Customer_ID, qryJOE_REPORT_2.CallResult, qryJOE_REPORT_2.RepName
FROM qryJOE_REPORT_2;