Trouble with DCount

LadyDi

Registered User.
Local time
Yesterday, 21:37
Joined
Mar 29, 2007
Messages
894
I am trying to create a message box that will tell me how many records were loaded into a table today. I'm using a DCount, but it keeps returning a 0. Am I doing something wrong? Here is the DCount that I am using.

DCount("[Device]", "StarReportTbl", "[Load Date]" = Date)
 
If Load Date stores the date and time then it will only show those added at midnight precisely.

Try:

DCount("[Device]", "StarReportTbl", "Int([Load Date])" = CLng(Date))

Converts the dates to integers, which strips out anything less than a day (the fractions) and so compares whole days
 
Try this..
Code:
DCount("[Device]", "StarReportTbl", "[Load Date]= # " & Date & "#")
 
That did it. Thank you very much for your assistance.
 

Users who are viewing this thread

Back
Top Bottom