By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,519 Members | 2,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,519 IT Pros & Developers. It's quick & easy.

Help needed with combined Dlookup/DatePart Syntax

P: n/a
I am using Acc97 and trying to get the following instruction to work
in the OnOpen event of a report:

DLookup("[GiftAmt]", "tblTempRevenueByFY", DatePart("m", [GiftDate]) =
1)

The table tblTempRevenueByFY exists, with data, as do the fields
"GiftAmt" and "GiftDate". However, when I try to preview the report, I
get 2465 error that says it cannot find the field "GiftDate". I have
tried every combination of quotes, double-quotes, parentheses, etc.
that I can think of and get mostly compile errors. I have also
searched the Google groups for insight without avail.

Any and all help is greatly appreciated

TC
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The 3rd argument (the WHERE part) needs to be in quotes as well. Note that I
put single quotes around 'm' to avoid problems with quotes within quotes.

DLookup("[GiftAmt]", "tblTempRevenueByFY", "DatePart('m', [GiftDate]) =1")
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Tony Ciconte" <to******@comcast.net> wrote in message
news:0j********************************@4ax.com...
I am using Acc97 and trying to get the following instruction to work
in the OnOpen event of a report:

DLookup("[GiftAmt]", "tblTempRevenueByFY", DatePart("m", [GiftDate]) =
1)

The table tblTempRevenueByFY exists, with data, as do the fields
"GiftAmt" and "GiftDate". However, when I try to preview the report, I
get 2465 error that says it cannot find the field "GiftDate". I have
tried every combination of quotes, double-quotes, parentheses, etc.
that I can think of and get mostly compile errors. I have also
searched the Google groups for insight without avail.

Any and all help is greatly appreciated

TC

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.