Results 1 to 2 of 2
  1. #1
    Orozvik is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    3

    Unhappy Help with two criteria in an IIF statement.

    Hi, i have probably a simple query rule to write but not so for me. I would be greatful in anyone on this forum can provide me with the help i need to get it right. Thanks ahead of time.

    Here is the quiery rule im trying to write supported by the excel attachment.

    Invoice Date Drop Date Obsolete
    20120113 20130501 No
    20130113 20120501 Yes
    20130113 0 No



    The Obsolete Field will hold this code in teh Query field box.

    Obsolete: IIf([tbl0100Data]![DROP_DATE]<>0,IIf([tbl0100Data]![INVOICEDT]>=[tbl0100Data]![DROP_DATE],"Y","N"))


    So what im asking for is if the drop date is not equal to "0" and the Invoice Date is Greater than the Drop Date to enter a "Y" for yes, otherwise a "N" for no. This

    I don't know if i should use a nested IIF which apparently i don't know how to set up correctly, or if i shoud use a "And" with one If?



    Any help would be greatly appreciated....thank.s
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Your expression does not include value if DROP_DATE = 0

    Obsolete: IIf([tbl0100Data]![DROP_DATE]<>0,IIf([tbl0100Data]![INVOICEDT]>=[tbl0100Data]![DROP_DATE],"Y","N"), something here)


    But maybe just:

    Obsolete: IIf([tbl0100Data]![DROP_DATE]<>0 AND [tbl0100Data]![INVOICEDT]>=[tbl0100Data]![DROP_DATE],"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.

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

Similar Threads

  1. Please Help: Combo Box Criteria Statement
    By mikeone610 in forum Queries
    Replies: 15
    Last Post: 01-27-2013, 09:27 PM
  2. Need Criteria added SQL Statement
    By Ran in forum SQL Server
    Replies: 4
    Last Post: 07-31-2012, 10:07 AM
  3. using two criteria in one case statement
    By chessico in forum Access
    Replies: 5
    Last Post: 03-14-2012, 03:25 PM
  4. Iif statement with multiple criteria
    By coach32 in forum Queries
    Replies: 1
    Last Post: 09-07-2011, 01:28 AM
  5. nested if statement with two criteria
    By kendra in forum Queries
    Replies: 5
    Last Post: 06-16-2009, 04:07 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