Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Posts
    7

    How to use IIF condition

    I am having data of city, against which i want state in next field and using iif condition.Getting error - The expression you entered has a function containing the wrong number of arguments.
    city---State
    AHMEDABAD,SURAT,VADODARA --- GUJARAT
    MUMBAI,NAVI,PUNE --- MAHA
    HYDERABAD,VISHAKAPATNAM --- ANDHRA
    CHENNAI --- TAMIL
    BANGLORE --- KARNA
    GURGAON --- HARYANA

    STATE: IIf([CELL],[AHMEDABAD],[Gujarat],iif([CELL],[SURAT],[Gujarat],iiF([CELL],[Vadodara],[Gujarat],IIf([CELL],[Mumbai],[Maha],IIf([CELL], [Navi],[Maha],IIf([CELL],[Pune],[Maha],IIf([CELL],[HYDERABAD],[Andhra],IIf([CELL],[VISHAKAPATNAM],[ANDHRA],IIf([CELL],[CHENNAI],[TAMIL],IIf([CELL],[BANGLORE],[KARNA],IIf([CELL],[GURGAON],[HARYANA])))))))))))

    Want to know is there any other way i.e using (And,Or) in iif condition.


    or some other way where two to three condition matches for similar result i.e city HYDERABAD,VISHAKAPATNAM Should have Andhra in state field.

  2. #2
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109

    Abbreviated Response

    I suspect you are looking for something like this

    State: IIf([City]='AHMEDABAD' Or [City]='SURAT','GUJARAT',IIf([City]='MUMBAI' Or [City]='NAVI','MAHA','No match'))

  3. #3
    Join Date
    Sep 2008
    Posts
    7

    Thanks a ton

    Hey Thanks

    But want to know in a iif condition can we put three option i.e IIf([City]='AHMEDABAD' Or [City]='SURAT', Or [City]='VADODARA','GUJARAT'.

    Please help...

  4. #4
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109
    Yes, it can take mutiple options.

  5. #5
    Join Date
    Sep 2008
    Posts
    7

    Thanks

    How it can be done, please show it..

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums