I have a report grouped by Examinations and Job Titles. The four types of job titles in my report I need: Accountants, Drivers, Other – OCONUS, and All Others.
My IIF statement in my query is as follows:
TypeOfJobTitle: IIf([PEAccountantsY]=True,"Accountants",
IIf([PPEJobTitle]="Accountant","Accountants",
IIf([OEJobTitle]="Accountant","Accountants",
IIf([DeployJobTitle]="Accountant","Accountants",
IIf([PSWSPJobTitle]="Accountant","Accountants",
IIf([PEDriverY]=True,"Drivers",
IIf([PPEJobTitle]="Driver","Drivers",
IIf([OEJobTitle]="Driver","Drivers",
IIf([DeployJobTitle]="Driver","Drivers",
IIf([PSWSPJobTitle]="Driver","Drivers","All Others"
)))))))))
This is Ok. Except, my problem: if [PPEJobTitle] and [DeployJobTitle] do not equal Accountant or Driver, then I want the occupation to be “Other – OCONUS”, since these occupations fall under the Overseas Examinations. I have used either “Or” or “<>” elements and have resulted in either a –1 or the Drivers become over-ridden by Other – OCONUS in the report. I’m not sure if an “IIF Statement” can contain a “<>” or “Or” element. Is there a way to accomplish my goal in the same IIF Statement? Curtis….
My IIF statement in my query is as follows:
TypeOfJobTitle: IIf([PEAccountantsY]=True,"Accountants",
IIf([PPEJobTitle]="Accountant","Accountants",
IIf([OEJobTitle]="Accountant","Accountants",
IIf([DeployJobTitle]="Accountant","Accountants",
IIf([PSWSPJobTitle]="Accountant","Accountants",
IIf([PEDriverY]=True,"Drivers",
IIf([PPEJobTitle]="Driver","Drivers",
IIf([OEJobTitle]="Driver","Drivers",
IIf([DeployJobTitle]="Driver","Drivers",
IIf([PSWSPJobTitle]="Driver","Drivers","All Others"
This is Ok. Except, my problem: if [PPEJobTitle] and [DeployJobTitle] do not equal Accountant or Driver, then I want the occupation to be “Other – OCONUS”, since these occupations fall under the Overseas Examinations. I have used either “Or” or “<>” elements and have resulted in either a –1 or the Drivers become over-ridden by Other – OCONUS in the report. I’m not sure if an “IIF Statement” can contain a “<>” or “Or” element. Is there a way to accomplish my goal in the same IIF Statement? Curtis….