Filter query results by date

ddlloyd

New member
Local time
Today, 02:33
Joined
Aug 25, 2010
Messages
2
Howdy all, i am new to access and have come accross a problem that i haven't been able to search out online. i've designed a simple database with a single input form that inputs to a single table.

my problem occurs with my queries. i use drop down boxes for almost all the fields on the form and i simply want the query to count the number of times a particular options was chosen, by month. i have designed queries (one for each field) that will count the number of times a drop down option is chosen but i can't figure out how to filter by date. date is one of the fields, but i can't get the query to utilize the dates that attached to the record.

any help would be much appreciated. thanks!
 
When you say "filter by date" are you talking about adding a from/to choice to the query. If so then just add the following criteria:

Code:
>=[Start Date (DD/MM/YYYY):] And <=[End Date (DD/MM/YYYY):]

to the field
 
yes, that is exactly what i'm trying to do. attached is a screen shot of the design view of one the queries. i want a count of the field within a date range. i tried the code listed above and access returned "this expression is typed incorrectly, or is too complex to be evaluated". i feel like i'm missing some integral part here.......

do i need to add more fields into the query? perhaps the date field?
 

Attachments

  • query.jpg
    query.jpg
    98.3 KB · Views: 157
The reason why it failed is because you are using date parameters on a numeric field (Count Of).

Try adding a new field, just plain date, and selecting type "group by". Then add the above code to the criteria for that column. You may also want to hide the field from view by unchecking the box marked "show".
 

Users who are viewing this thread

Back
Top Bottom