Dcount using date comparison

vendredi 6 mars 2015

Hi Everyone,



I'm trying reference a dcount on two fields, one is a string and works fine, the other is on a date which does not.



I've investigated the problem and found a couple of references to making sure I use a # symbol to reference the date but I think the thing that's throwing the comparison out is that the date field stores time as well, even if you can't see it?



So my code:




Code:



MsgBox DCount("*", "[healthcheck]", "[check_date]=#" & Format([Forms]![MAINTENANCE_FRM]![MAINTENANCE_DETAIL_TBL subform].[Form]![FIRST_HEALTH]) & "#")


I thought should count the records in the healthcheck table that match the check_date field against the first_health field on the current form, but I keep getting a 0 count even though the dates seem to match.



Any thoughts?

Dcount using date comparison

0 commentaires:

Enregistrer un commentaire

Labels