View Single Post
  #4  
Old May 6th, 2010, 04:00 PM posted to microsoft.public.access.queries
SSi308
external usenet poster
 
Posts: 42
Default Create a Query that Prompts for Date and Time

Dorian,

Thanks for the reply, I finally did get this to work. My error was that I
had added a line in the query for totals and was trying to total the date
field. After changing back to group the query ran fine.

I am interested in how to do this with a form versus a query though. I
thought the query needed to be set up first then a form could be created from
that.

Lori

"Dorian" wrote:

You can do it in a query but it's much better to create a form for the user
to enter the dates and times and then to run the query from a command button.
The query will refer to the form controls to get the dates and times.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"SSi308" wrote:

I am in the beginning stages of setting up a call database that tracks calls
made by sales people. The table includes separate fields for date and time.

A query is needed that will prompt for a date range and time range.
For example a user may want a report that shows all calls for April 1
through April 7 between 11:00 AM and 12:00 PM.

I created the query for a time range, which worked. I then added the
expression, for date range: =[Start Date] And =[End Date] I have also
tried: BETWEEN [Start Date] AND [End Date]

Both expressions get the same error when trying to run the query:
"This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables."

For your reference the time expression is: Between [Start Time] And [End Time]

How do I set up the query to allow choosing both date range and time range?

There are other criteria that will also need to be added, but thought I
should get this working first. Thanks for any help you can give.

Lori