Counting records and Where criteria

  • Thread starter Thread starter Tony Williams
  • Start date Start date
T

Tony Williams

I'm trying to count the number of records between date parameters. I have a
query that I'm using the Count function to count the number of txtrefnbr and
in the Criteria I've used
Where [txtdaterecd]=Between [Forms]![frmdates]![txtfrom] And
[Forms]![frmdates]![txtto]
But I get an invalid syntax error. Anyone help?
Thanks
Tony
 
Use --- Where [txtdaterecd] Between [Forms]![frmdates]![txtfrom] And
[Forms]![frmdates]![txtto]

No equal when using between.
 
What is [txtdaterecd]?

If it is a field in a table, when you open the table in design view, is it a
Date/Time field?

If it is a calculated query field, wrap the calculation in CVDate() so
Access understands the data type.

If txtfrom and txtto are unbound text boxes, set the Format property to
Short Date (or similar) so Access understands the data type.

Explanation of why in this article:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
 
Back
Top