Query Error: "Expession is too complex"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cori25
    New Member
    • Oct 2007
    • 83

    Query Error: "Expession is too complex"

    Code:
    Paycode': IIf([Project Code]="01","Meeting",IIf([Project Code]="02","Training",IIf([Project Code]="04","Special Project",IIf([Project Code]="05","QC",IIf([Project Code]="06","MDU",IIf([Project Code]="07","UG",IIf([Project Code]="08","2nd Man",IIf([Project Code]="09","Sr Tech Other",IIf([Project Code]="10-1","Loan Out to Nassau",IIf([Project Code]="10-2","Loan Out to Suffolk",IIf([Project Code]="10-3","Loan Out to CTHV",IIf([Project Code]="10-4","Loan Out to Bronx",IIf([Project Code]="10-5","Loan Out to Brooklyn",IIf([Project Code]="10-6","Loan Out to NJ North",IIf([Project Code]="10-7","Loan Out to NJ South",[Project Code],IIf([Paycode Name]="SHIFT","REG",IIf([Paycode Name]="OT","REG",[Paycode Name]))))))))))
    I am attempting to execute this criteria in a query and "Expression is too complex" keeps coming up. When I take a few if statements out, it works fine. Is there any way around this because I need all the above to occur.

    Thanks in advance...

    Cori
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hello, Cori.

    I would say that nested iif() is a "way around". A straightforward way, advantageous in all aspects, is lookup table.

    Regards,
    Fish

    Comment

    Working...