Results 1 to 2 of 2
  1. #1
    amcintosh is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2020
    Posts
    6

    DLookup between two dates from a query

    Quick one, i'm currently trying to figure out a dlookup expression in a Query field

    So i'm trying to write this expression where I wanted to do a Dlookup from another field within the same query (Date Rejected) to return a Date by looking at the date between 2 dates in a table
    Code:
    Expr1: DLookUp("[DateTo]","LUP-Trend-FinWeeks","[LUP-Trend-FinWeeks].DateFrom' <=#" & [DateRejected] & "# [LUP-Trend-FinWeeks].[DateTo] >= #" & [DateRejected] & "#")
    i.e.



    If Rejection Date = 5/1/21, I want the DLookup to return 7/1/21

    1/1/21 7/1/21
    8/1/21 14/1/21
    15/1/21 22/1/21
    23/1/21 30/1/21
    obviously this is purely an example.

    Any ideas?

  2. #2
    amcintosh is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2020
    Posts
    6
    Never mind. I screwed up

    DLookup("DateTo","LUP-Trend-FinWeeks","DateFrom <= #" & [DateRejected] & "# AND DateTo >= #" & [DateRejected] & "#")

    Works now

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

Similar Threads

  1. Replies: 2
    Last Post: 09-19-2017, 11:31 AM
  2. Dlookup() With Multiple Criteria (Specifically: a String, & Two dates)
    By QA_Compliance_Advisor in forum Programming
    Replies: 19
    Last Post: 07-09-2015, 05:26 PM
  3. Replies: 2
    Last Post: 01-22-2014, 09:38 AM
  4. Replies: 11
    Last Post: 04-30-2012, 07:22 PM
  5. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM

Tags for this Thread

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