DLookup for Multiple Criteria including a Between

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmkingpin
    New Member
    • Jul 2015
    • 2

    DLookup for Multiple Criteria including a Between

    DLookup works great when i just use a between argument but as soon as I add the second criteria where the [Data Month] must match the [PayoutYear] I get blanks or errors based on the syntax. It this possible? If so, how?

    Code:
    DLookUp("[PayoutTier]","t_PayoutGrid",[Bump iGPQ] & " Between [iGPQLow] and [iGPQHigh]" & "' and [PayoutYear] = " & Left([Data Month],4)))
    Last edited by zmbd; Jul 11 '15, 07:00 AM. Reason: [z{placed code tags}]
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    The syntax for your criteria would be
    Code:
    "[Bump iGPQ] Between " & [iGPQLow] & " And " & [iGPQHigh] & " And [PayoutYear] = " & Left([Data Month], 4)
    This assumes that each field is a number field.

    Comment

    • jmkingpin
      New Member
      • Jul 2015
      • 2

      #3
      I could swear I tried that on one of my 50 attempts, but clearly I did not because yours worked! Thank YOU!

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32663

        #4
        Sometimes that's all it takes. Trying something again carefully that you thought had already failed the test.

        I often find when I run through for someone what I've already tried, it just works.

        Comment

        Working...