Date range parameters

  • Thread starter Thread starter DW
  • Start date Start date
D

DW

I have a query which uses the criteria of a sale date
between [startdate] and [Enddate]. Start date and End date
are date parameters. The query returns the correct records
for any date range. The report returns the correct records
if the date range is a year or less. If the date range is
greater than a year, I get the message " This exression
is typed incorrectly, or it is too complex to be
evaluated. I am not using any different calculations, just
a greater date range. Has anyone seen this? I thank you in
advance for any help on this.
DW
 
The first thing I'd try is to hard-code a date range into the criteria
fields and see what it does. By the way, your description only said the
Start- and End-date are "date parameters". Does that mean the underlying
field is a DateTime datatype?

Good luck

Jeff Boyce
<Access MVP>
 
I found my own problem, the field I was calculating the
averages on was calculated. In one of the records which
was included in the longer date range, there was a div by
zero error.
Thanks
-----Original Message-----
Jeff-
Hard-coding the date range gives the same error when
running for a date range greater than a year.

The exact query criteria is :

Is Not Null And Between [Enter Begin Date mm/dd/yyyy] And
[Enter End Date mm/dd/yyyy]

The parameters[Enter Begin Date mm/dd/yyyy],[Enter End
Date mm/dd/yyyy] are both parameters of the date/time data
type in the query. Sale date, the actual field I am
checking, is a date time data type in the table.

The query runs without error regardless of the date range
and the report runs without error if the date range is 1
year.
*More information---
I just realized that when I remove the avg() function that
I have in the group footer on the report to find the
average of one of the fields, the report will run for a
larger date range. So it possibly has something to do with
the avg() function and the number of years or records?
Does that give you any clues?
Thanks-DW
-----Original Message-----
The first thing I'd try is to hard-code a date range
into
the criteria
fields and see what it does. By the way, your description only said the
Start- and End-date are "date parameters". Does that mean the underlying
field is a DateTime datatype?

Good luck

Jeff Boyce
<Access MVP>

.
.
 
Back
Top