Hi guys, I'm having a problem when trying to DCOUNT the number of total records in a table, containing a specific date in a Date/Time field in this table.
The code I'm trying to use and that used to work for me is this:
I've been using this code so far and worked nicely, but I don't understand why I'm having a problem on this particular example.
When debugging on the inmediate window, I get that dDate = #04/11/2019#, which is correct, but the DCOUNT is always 0, while in this table it exists records with this specific date.
Also the field in the table is set up as Date/Time and the format of it as Short Date.
Any clue or suggestion on how I could do this in any other way? Or why is not working with this particular example when it used to work for me? I tried several ways of doing this and I can't get to it.
Thanks for reading
The code I'm trying to use and that used to work for me is this:
Code:
Dim dDate as String
dDate = "#" & Date & "#"
DCount("*","tblWhatever","DATE = " & dDate)
I've been using this code so far and worked nicely, but I don't understand why I'm having a problem on this particular example.
When debugging on the inmediate window, I get that dDate = #04/11/2019#, which is correct, but the DCOUNT is always 0, while in this table it exists records with this specific date.
Also the field in the table is set up as Date/Time and the format of it as Short Date.
Any clue or suggestion on how I could do this in any other way? Or why is not working with this particular example when it used to work for me? I tried several ways of doing this and I can't get to it.
Thanks for reading