Counting Date Occurrences

G

Guest

Hi Everyone. This is a new forum for me. Be patient!!
I have a simple database that has a list of training different training
courses and the dates that people have attended or is null if they havnt. I
am running a report based on a query that runs through a form to give the
date criteria. I wish to count the number of adtes that are entered against
each training course. As theyu are all one day training courses this will
give me the total training days in any given period. In each of my courses
within the query I have set the "Total" to "Count" and each has a criteria
with the statement "Between [Forms]![Date]![StartDate] and
[Forms]![Date]![EndDate] And Is Not Null"
Everything seems to run but the query keeps failing and not offering any
result.

can anyone offer me a solution as to why this does not run properly??

Thanks

Phil
 
A

Allen Browne

The most likely explanation is that Access is not understanding the data
types correctly.

If the text boxes on the form are unbound, set their Format property to
Short Date or similar.

Also, make sure the focus has moved out of both text boxes. The value is not
updated if the focus is still in the box.

Presumably this criteria is in your query, underneath a date/time field. You
can also help ensure the query understands it correctly by declaring the
parameters. Choose Parameters on the Query menu, and enter 2 rows in the
dialog, like this:
[Forms]![Date]![StartDate] Date/Time
[Forms]![Date]![EndDate] Date/Time

If the field in the query is a calculated one, Access can misinterpret that
too. See:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"Phil the madgolfaddict" <Phil the (e-mail address removed)>
wrote in message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top