Results 1 to 2 of 2
  1. #1
    engr_saud1 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Posts
    10

    Multiple conditions in Access

    Hi ,
    I am trying to calculate [current status] based on multiple conditions. for example
    Current status = A , if (w>0 and x=0 and y=0 and z=0)

    Current Status =B , if(w>0 and x>0 , y=0 and z=0)
    Current Status =C , if(w>0 and x>0 and y>0 , z=0)

    Current status =D , if(w>0 and x>0 and y>0 and z>0)


    Where A,B,C,D are text values and w,x,y,z are dates


    Thanks!

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    There are a few different ways of doing it. You could use a nested IIF function in an Access calculated field.
    Or, if you have a lot of conditions, I often find it easier to create a User Defined Function (UDF) in VBA, using nested IF functions or Case statements.

    I have a question though. If w,x,y,z are really dates, will they ever really be equal to 0? Or do you have NULL values instead?

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

Similar Threads

  1. Replies: 3
    Last Post: 08-01-2012, 10:56 AM
  2. Using iif for Multiple Conditions
    By kwilbur in forum Access
    Replies: 5
    Last Post: 12-30-2011, 01:52 PM
  3. iif statement with multiple conditions
    By ragsgold in forum Queries
    Replies: 7
    Last Post: 08-24-2011, 05:38 PM
  4. Macros within Forms/Multiple Conditions
    By screwdrew1 in forum Forms
    Replies: 0
    Last Post: 04-11-2011, 01:28 PM
  5. Expression with multiple conditions
    By techexpressinc in forum Queries
    Replies: 3
    Last Post: 06-19-2009, 08:33 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