I'm trying to check a table to see if it has any records that have been added today. In the table I have a [date created] field which is being createded with a default of now() and the format is set to short date.
I'm trying to use DCOUNT to count the records that have a today date. I will then apply an 'if..then' to it, but my DCOUNT isn't giving me the correct answer.
example #1
this gives me 0.
What am I missing?
I'm trying to use DCOUNT to count the records that have a today date. I will then apply an 'if..then' to it, but my DCOUNT isn't giving me the correct answer.
example #1
Code:
Dim varchecktoday As Variant
varchecktoday = DCount("[Field2]", "Cash master file", "[date created] = #" & Format(Now(), MM, DD, YYYY) & "#")
MsgBox varchecktoday, vbOKOnly
this gives me 0.
What am I missing?