Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2008
    Posts
    18

    Unanswered: Nested IIF statement

    [Using Access 2003 on XP Pro]

    Why won't this nested IIF statement work? It's a statement for a query:

    I included extra space for ease of reading.

    Admin LT: iif([Reason]="Commercial",
    (iif([Start Dt] Is Null,
    networkdays([Case Open Dt],Now()), networkdays([Case Open Dt],[Start Dt])),
    (iif([Start Dt] Is Null,
    networkdays([Input Dt],Now()), networkdays([Input Dt],[Start Dt])))
    It keeps telling me "The expression you've entered is missing a closed parenthesis, bracket or vertical bar.

    Please help...

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    At a glance, I see 3 IIf functions opening but only 2 closing parentheses (since 1 of the 3 closes the networkdays function). I debug them by reducing the arguments to a single letter. See the problems now?

    iif(C,(iif(C, T, F), (iif(C, T, F))
    Paul

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Here is an Example:



    status: iif([pbv_art] between "0005" and "0013" OR [pbv_art] between "0055" and "0056";"Worker";
    iif([pbv_art]="0025";"Auszub.";
    iif([pbv_art] between "0030" and "0038";"Employee";"??")))

Posting Permissions

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