Results 1 to 4 of 4
  1. #1
    aflamin24 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jul 2012
    Posts
    7

    Nested IIF for two comparisons

    Hi,



    I would like to alter this statement so that any number less than 20 is "PRIMARY", any number between 20 and 26 is "SEC" and any number greater than 26 is "SEC2". I think I need to add another IIf() but I'm not really sure of the syntax. Thanks in advance if anyone can help me.

    SEC_NR: IIf((Left([BAY_NR],2)>=26),"SEC2","PRIMARY")

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I think you'll find the Switch() function simpler. If you want to stick with the nested IIf(), you'd place a second IIf() in the False argument of the first, testing for >= 20.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    aflamin24 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jul 2012
    Posts
    7
    Thanks for the help, and next time I will go with the Switch() for sure.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Nested IIF
    By Oldie in forum Queries
    Replies: 1
    Last Post: 02-17-2012, 06:04 AM
  2. Nested If statement
    By Bellablue in forum Access
    Replies: 7
    Last Post: 10-09-2011, 12:00 PM
  3. Weekly reporting comparisons in query
    By Schon731 in forum Queries
    Replies: 3
    Last Post: 10-21-2010, 06:59 PM
  4. Nested Iif statement help
    By Goodge12 in forum Queries
    Replies: 6
    Last Post: 09-21-2010, 11:45 AM
  5. Grouping from several comparisons
    By piflechien73 in forum Queries
    Replies: 3
    Last Post: 05-26-2009, 04:15 PM

Tags for this Thread

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