mtrussell
asked on
Dcount using a date in a table compared to today's date
This should be straight forward but it isn't. I am trying to count the number of records in a table where the date in a field is less than the current date. What I have is the below but it is kicking out an error code.
=DCount([id],[Tbl_ClientCo mmunicatio n],"[calcd ate] & Date()")
Does anyone know how to write this so it works?
=DCount([id],[Tbl_ClientCo
Does anyone know how to write this so it works?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry Bill. Anders is right. Your code will fail on this side.
/gustav
/gustav
The following should work in all regions:
Open in new window
In Bill's code, the Date is first interpreted by VBA, and formatted according to regional settings. In the second case, the date() is called directly by the database engine, and you avoid any regional issues.