Results 1 to 4 of 4
  1. #1
    lpfluger is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    4

    Unhappy HELP with IIF function

    Hi everyone, Im trying to run an update query based on the next IIf function:

    IIf([Proc]![Value]=1,0,(IIf([Proc]![Value]>1 & [Proc]![Value]=<15,1,(IIf([Proc]![Value]>15 & [Proc]![Value]=<30,2,Null)))))

    But the problem is that only works for the first condition, that is, [Proc]![Value]=1. The rest of the records are updated to 1, including those that should be 2 or Null.



    Can someone tell me what I'm doing wrong please?

  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,521
    You want to separate tests with AND rather than &. & is a concatenation operator.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    lpfluger is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    You want to separate tests with AND rather than &. & is a concatenation operator.

    Yes!!!! now it works perfectly.
    I'm going to make you a monument pbaldy

    Thanks !!!

  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,521
    LOL! Happy to help.
    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. DDE Function gone?
    By djcomlab in forum Programming
    Replies: 7
    Last Post: 11-23-2010, 11:01 AM
  2. Help with AVG function
    By techexpressinc in forum Reports
    Replies: 1
    Last Post: 03-23-2010, 07:47 AM
  3. Want function to get current function name
    By Davis DeBard in forum Programming
    Replies: 2
    Last Post: 08-13-2009, 05:02 AM
  4. function key
    By marianne in forum Access
    Replies: 5
    Last Post: 05-14-2009, 01:26 AM
  5. Avg Function
    By hiker8117 in forum Access
    Replies: 3
    Last Post: 04-23-2009, 11:14 PM

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