Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2011
    Posts
    4

    Unanswered: Query Field /w multiple criteria

    OK I am very pretty new at Access as I have mostly always used Excel for most things. However, I am kind of stuck here. I need to write an expression /w multiple If conditions. Basically I have a dlookup field as so:

    Ent Due Date: DLookUp("[Due Date]","tblTrainingDates","[Course ID] = '" & [Item Id] & "'")

    Now I need to create another field based off of that.... if I was doing this in Excel it would be: =IF(AND(C2<>"",C2>B2),"Y","N") if C2 = [Ent Due Date] and B2 = [Completion Date].

    Basic idea is I want a field saying "Y" IF [Completion Date] > [Ent Due Date] AND [Ent Due Date] Not Null.

    I hope that makes sense....

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Code:
    FieldName = IIF(([Completion Date] > [Ent Due Date]) AND (Not IsNull([Ent Due Date])),"Y","N")
    See the IIF() (Immediate If) function in the Help file for details.

    Sam

  3. #3
    Join Date
    Dec 2011
    Posts
    4
    Well now I feel stupid lol... in hindsight that was kind of obvious.

    Thanks for the help.

  4. #4
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    You're very welcome.

    Welcome to Access!

    Sam

Posting Permissions

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