Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-27-2019, 11:11 PM   #1
Takunda Mafuta
Newly Registered User
 
Join Date: Sep 2019
Location: Zimbabwe
Posts: 13
Thanks: 5
Thanked 0 Times in 0 Posts
Takunda Mafuta is on a distinguished road
Dlookup into a query field using Date Criteria

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] & "#")
Attached Images
File Type: png SourceTable.png (15.1 KB, 4 views)
File Type: png ExpressionBuilder.png (6.6 KB, 4 views)
File Type: png ResultantQuery.png (11.7 KB, 5 views)

Takunda Mafuta is offline   Reply With Quote
Old 10-27-2019, 11:15 PM   #2
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Dlookup into a query field using Date Criteria

DLookUp("EXCRate","ExchangeRates","EXCDate=#" & Format([DateEntered], 'mm\/dd\/yyyy') & "#")
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
Takunda Mafuta (10-27-2019)
Old 10-27-2019, 11:20 PM   #3
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,308
Thanks: 115
Thanked 3,095 Times in 2,813 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Dlookup into a query field using Date Criteria

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

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
Reply

Tags
expression builder , expression syntax , querie fields

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Dlookup with Date Criteria SjCc General 5 11-14-2018 06:00 PM
DLookup with date field and other criteria Delid4ve Modules & VBA 7 03-24-2017 07:58 AM
DLookup() with Date criteria John Big Booty General 29 02-24-2016 04:44 AM
Conditional Criteria for a Date Field in a Query ions Queries 20 07-22-2008 06:13 AM
Dlookup using Date as criteria sambo Modules & VBA 1 09-16-2002 02:47 PM




All times are GMT -8. The time now is 10:44 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World