Results 1 to 3 of 3

Thread: IFF statements

  1. #1
    Join Date
    Dec 2002
    Location
    Phoenix, AZ
    Posts
    122

    Unanswered: IFF statements

    I have an IIF statement in one of my expressions. Here it is:
    PP Status: IIf(Names!status_code1=1,"ACTIVE",IIf(Names!status _code1=2,"CRDNTL",IIf(Names!status_code1=4,"Pilot" ,IIf(Names!status_code1=9,"ACTBNKRPT",IIf(Names!st atus_code1=99,"Cancel",IIf(Names!status_code1>=800 And Names!status_code1<=899,"CRED",IIf(Names!status_co de1=980,"C_DEV",IIf(Names!status_code1=990,"C_PMT" ,"DELETED"))))))))
    Basically all it does is change the status code number to its corresponding name.

    My question(s) is how many 'nested' IIF statements can you have. We have added at least 50 more status codes so I will have to add at least that many to this IIF statement. Is this going to work?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    ye gods that looks messy

    why don't you store the 50 codes in a small table and do a join?


    rudy

  3. #3
    Join Date
    Dec 2002
    Location
    Phoenix, AZ
    Posts
    122

    Unhappy

    yeah, I was going to do that but... I inherited this database from someone who no longer works here. It has alot of expressions that look similiar to this one. If I change it, I would have to changed MULTIPLE queries and reports and forms. It's just the way this database is built. I guess I should just change it then... THANKS for your reply

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •