Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    9

    Unanswered: Help with DLookup

    HI,

    I need a bit of guidance with DLookup in a query.

    I have a table that holds 2 dates (From Date and To Date)

    I have created a query to filter data and it looks at the table for a date range.

    IIf([Period]=Dlookup("[From]","Period"),[Advance],0)

    This parts works fine.

    However I also need to filter between 2 date ranges:

    IIf([Period]=Between Dlookup("[From]","Period") and DLookup("[To]","Period"),[Advance],0)

    I thought this would work but it does not, what am I doing wrong.

    Please advise.

    Thanks

    Darrell......

  2. #2
    Join Date
    Sep 2003
    Posts
    228
    IIf([Period]=Between Dlookup("[From]","Period") and DLookup("[To]","Period"),[Advance],0)

    Shouldn't this be

    IIf([Period] Between Dlookup("[From]","Period") and DLookup("[To]","Period"),[Advance],0)

    No equal sign.

  3. #3
    Join Date
    Oct 2002
    Posts
    9
    Thanks,

    That works fine now.

    Darrell....

Posting Permissions

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