Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2002
    Location
    TX
    Posts
    34

    Post Unanswered: expression is too complex

    in a query, using an iif statement, I have 11 conditions, on entering the tenth one it says my expression is too complex. Is there a way around that?

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Try

    switch()

    choose()

    Don't take this error message too literally. It sometimes comes up when other problems exist, like bad data.

  3. #3
    Join Date
    Apr 2002
    Location
    TX
    Posts
    34
    what does the switch() or choose() functions look like? Their format I mean.

  4. #4
    Join Date
    Jun 2002
    Location
    Central New Jersey
    Posts
    69
    SWITCH()

    The following example uses the Switch function to determine the appropriate language for a specified city based on the values of the ShipCountry and ShipCity fields in an Orders table. You can enter the following expression in a calculated control on a form or report. The expression is shown on multiple lines for clarity; you can also enter it on a single line.

    = Switch([ShipCity] = "Madrid", "Spanish", _
    [ShipCity] = "Berlin", "German", _
    [ShipCity] = "Torino", "Italian", _
    [ShipCountry] = "France", "French", _
    True, "English")

    If the city is Madrid, the Switch function returns "Spanish"; if it is Berlin, it returns "German"; and so on. If the city is not one of those listed, but the country is France, it returns "French". If the city in question is not in the list, the Switch function returns "English".

    CHOOSE()

    You can use the Choose function to create a calculated control whose value is determined by the value of a field in a table in your database. For example, suppose you have a Shippers table that contains a field called ShipperID. You could create a calculated control on a form to display a text name for the shipper based on the value of the ShipperID field.

    =Choose([ShipperID], "Speedy", "United", "Federal")

    These came from the MS Access help online.
    "There's never enough time to do it right, but there's always enough time to do it over!"

  5. #5
    Join Date
    Apr 2002
    Location
    TX
    Posts
    34
    Thanks JD, I searched the MS help and support website and looked in the A2K online help, guess I didn't search good enough. Thanks for your help.

  6. #6
    Join Date
    Apr 2002
    Location
    TX
    Posts
    34
    Worked great!!!!!!!!!!!!!!!!!!!!
    Switch([isize]<0,0+[exutiss],[isize]<0.3,1+[exutiss],[isize]<0.7,2+[exutiss],[isize]<=1,3+[exutiss],[isize]<2.1,4+[exutiss],[isize]<=3,5+[exutiss],[isize]<=4,6+[exutiss],[isize]<=8,7+[exutiss],[isize]<=12,8+[exutiss],[isize]<=24,9+[exutiss],[isize]>24,10+[exutiss])
    Thanks a bunch!

Posting Permissions

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