Query Count between two dates

michaeljohannes

Registered User.
Local time
Today, 01:33
Joined
May 3, 2007
Messages
67
Hello,

I think this might be a typical question for query builders, so I apologize in advance for asking something so basic.

I have a form with two controls (start_date) and (finish_date).

Is there a way that I can create a query that will count the number of times a "source" has been entered into a table?

For example, I have a database where potential customers call and ask about our services. We ask them "Where did you hear about us?", hence the "source" field (which is a drop down combo box to normalize that field's data).
With this record is their "dateofcall" which is (obviously) a date field.

I'd like to create a report that will count the number of times a "source" has been entered between two dates "dateofcall" (the start and finish date above).

I have tried many types of queries and haven't found any success. The nice thing about the two form controls is that I can use those two controls for a variety of all types of queried reports. (the user enters a start and a finish date, fires a command button that generates a given report between those two dates). And it works well!

Can anyone help? I'd be most appreciative!

Mike
 
Create a totals query, put the source field in twice, under one use group By and under the other put Count. Add your dateofcall field using Where and sets it criteria to Between Forms![nameofyour form]![start_date] And Forms![nameofyour form]![to_date]
 
Hello Michael,

Thank you very much for your help! I was actually close but didn't know how to properly use the 'where' condition.

Much appreciated!

Mike :)
 

Users who are viewing this thread

Back
Top Bottom