Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dcount with date not working 1

Status
Not open for further replies.

dinster

Programmer
Apr 12, 2007
54
GB
Hi all,

Am trying to use this code in the control source of a textbox and i get an error msg. Am not sure where i gone wrong :s

Code:
=DCount("[ID]","sheet4","dateadded BETWEEN #" & 1/11/2007 & "# AND #" & 30/11/2007 & "#")

many thanks
 
You dates are not variables, so they need to be inside the quotes. You must use unambiguous dates, and the easiest way to do this is to use yyyy/mm/dd, so:

[tt]=DCount("[ID]","sheet4","dateadded BETWEEN #2007/11/01# AND #2007/11/30#")[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top