Results 1 to 5 of 5
  1. #1
    JustAccess is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    4

    Multiple conditions when building

    I need help in correcting an expression. Can't seem to get the right combination of commas, etc. I need to verify if data exists in 2 fields that the data equals ;OR if no data exists in BOTH fields then that is also considered to be equal. If the data equals then it should return a "Y" otherwise "N" . If anyone knows how to correct this it would be greatly appreciated!

    PROJ CODE: IIf(([Award Notification]![Special Project Code]=[By Call Number]![Proj Code]) Or IIf(AND(IsNull([Award Notification]![Special Project Code],IsNull([By Call Number]![Proj Code])),"Y","N")

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Try:

    PROJ CODE: IIf(Nz([Award Notification]![Special Project Code],0)=Nz([By Call Number]![Proj Code],0), "Y", "N")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    JustAccess is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    4
    Quote Originally Posted by June7 View Post
    Try:

    PROJ CODE: IIf(Nz([Award Notification]![Special Project Code],0)=Nz([By Call Number]![Proj Code],0), "Y", "N")

    This works for the null piece but when I try to combine with the first part (where if there is data it verifies that they are equal) it bombs and states I have the wrong number of arguments. Is the "OR" part connecting it correctly?


    PROJ CODE: IIf([Award Notification]![Special Project Code]=[By Call Number]![Proj Code] Or IIf(Nz([Award Notification]![Special Project Code],0)=Nz([By Call Number]![Proj Code],0), "Y", "N"))

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Don't need any OR part.

    Just the expression as suggested should do what you want.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    JustAccess is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    4
    You are correct! Thank you so much, I would have never figured that out.

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

Similar Threads

  1. Multiple conditions in Access
    By engr_saud1 in forum Access
    Replies: 1
    Last Post: 04-03-2013, 06:18 AM
  2. Replies: 3
    Last Post: 08-01-2012, 10:56 AM
  3. Using iif for Multiple Conditions
    By kwilbur in forum Access
    Replies: 5
    Last Post: 12-30-2011, 01:52 PM
  4. iif statement with multiple conditions
    By ragsgold in forum Queries
    Replies: 7
    Last Post: 08-24-2011, 05:38 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