Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012
    Posts
    108
    Provided Answers: 1

    Unanswered: Nested IIF Logic Error

    Hi all,

    Using Access 2013

    I can't seem to find the error in my nested IIF statement (Wrong Number of Arguments)

    Any thoughts?

    thx
    w

    AmountLogic: IIf([EffDtSameFirstDay]=-1 And [EndDtSameLastDay]=-1,IIF(error([Amount]/DateDiff("m",[eff_dt],[end_dt]),[Amount],[Amount]/DateDiff("m",[eff_dt]),[Amount]/DateDiff("m",[eff_dt],[end_dt],0))

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    it's missing the False argument for the first iif...

    TEST:
    IIf([EffDtSameFirstDay]=-1 And [EndDtSameLastDay]=-1,

    TRUE:
    IIF(error([Amount]/DateDiff("m",[eff_dt],[end_dt]),[Amount],[Amount]/DateDiff("m",[eff_dt]),[Amount]/DateDiff("m",[eff_dt],[end_dt],0)

    FALSE:
    )
    need to add a comma and what to do if TEST is false before the last parenthesis

Posting Permissions

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