Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    23

    Unanswered: "Wrong number of arguments..." what's causing this error?

    I have a bunch of nested IIfs (I know this is a no no, but I'm not very good at coding so I just have to get the job done) and it lets me save the query, but when I run it the error is "Wrong number of arguments used with function in query expression." My thought is that the usage of parens may be wrong, here's my code:

    IIf(([Margin]=1.25),99.375,IIf([Margin]=1.375),99.8125,IIf([Margin]=1.5),100.25,0)

    and the previous column in the query is named [Margin] which pulls as a number.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Try this:

    IIf([Margin]=1.25,99.375,IIf([Margin]=1.375,99.8125,IIf([Margin]=1.5,100.25,0)))
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2003
    Posts
    23

    Perfect

    Thanks for you help

Posting Permissions

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