DCount and Filter using the Format(xx,yy) (1 Viewer)

G

gzuroweste

Guest
I am tring to count the records in a specific time frame. The DCount function works fine in counting the total records, until I try to enter my criteria. It still returns total records. I must be using the wrong syntex.

intX = DCount("[No]", "Turrent", (Format(Me.Date, yy) = Format(Now, yy)))

Any help would be nice.




[This message has been edited by gzuroweste (edited 03-21-2001).]
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:17
Joined
Feb 19, 2002
Messages
43,373
It looks like you have named your form field "Date" and your table field "Date". And Access already has a function named "Date". This is beginning to sound like the running joke from the old Bob Newhart Show - "This is my brother Darrel and this is my other brother Darrel".

Be a little more descriptive with your names and NEVER re-use as a name something Access considers a reserved word. If you're in doubt about whether a word is reserved by Access, just look it up in help.

Your DLookUp() might work if you surround the two "Dates" with square brackets. That's a clue to Access that you are referring to an object you named. If that doesn't fix it - rename your objects.
 

Users who are viewing this thread

Top Bottom