lookup date AND time problems

Paul_B

Registered User.
Local time
Today, 19:44
Joined
Mar 5, 2002
Messages
19
can anyone please explain why this code works....

xxx = "Format([Start],'dd/mm/yyyy hh:nn') between #22/01/2004 00:00# and #22/01/2004 23:59#"
DCount("[id]", "[query]", xxx) 'result is 2

and this code doesn't:

xxx = "Format([Start],'dd/mm/yyyy hh:nn') between #22/01/2004 00:01# and #22/01/2004 23:59#"
DCount("[id]", "[query]", xxx) 'result is now 0

I need to count the number of occurence between any two times on a given day. It works for whole days, however if the criteria is refined to minutes or hours I get a zero count?

thanks
Paul.
 
Try checking [Start] without the associated formatting in your code if Start is a real "Date;" the format function doesn't do anything for you and probably creates a string.
 

Users who are viewing this thread

Back
Top Bottom