Dlookup into a query field using Date Criteria (1 Viewer)

Takunda Mafuta

Registered User.
Local time
Today, 08:43
Joined
Sep 4, 2019
Messages
13
I want to query figures from a table into my query using date criteria but when I run the query I get only blanks. The expression I'm using in the expression builder is as follows. See also attached images.
Code:
XE: DLookUp("EXCRate","ExchangeRates","EXCDate=#" & [DateEntered] & "#")
 

Attachments

  • SourceTable.png
    SourceTable.png
    15.1 KB · Views: 66
  • ExpressionBuilder.png
    ExpressionBuilder.png
    6.6 KB · Views: 83
  • ResultantQuery.png
    ResultantQuery.png
    11.7 KB · Views: 63

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:43
Joined
May 7, 2009
Messages
19,169
DLookUp("EXCRate","ExchangeRates","EXCDate=#" & Format([DateEntered], 'mm\/dd\/yyyy') & "#")
 

isladogs

MVP / VIP
Local time
Today, 15:43
Joined
Jan 14, 2017
Messages
18,186
DateEntered contains a time which you need to exclude.
Also, why not link the two tables in your query using the date part of the DateEntered field and ExcDate fields. This avoids the needs for a DLookup
 

Users who are viewing this thread

Top Bottom