Access generates the "too complex" message if it can't understand the SQL
statement. There can be lots of reasons, but the problem here is that you
are trying to treat *operators*, not just values, as if they were
parameters.
That approach is not going to work. If you switch your query to SQL View,
you will see that it interprets it as nonsense such as:
WHERE MyField = "Between ...
Clearly the date field doesn't match that text. In fact trying to match the
text to the date value doesn't make any sense. And since Access can't make
any sense of the query, you get the error.
If you are filtering just on these dates, see:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html
for a couple of ways to handle this.
If you are actually trying to filter on lots of fields (including the date
range), this should help:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Bill said:
I am trying to figure out why the month of August 2007 is generating "too
complex" errors in the control source of a text box in a report. This is
the
formula:
"Between" & " " & [Enter Start Date] & " " & "And" & " " & [Enter End
Date]
When I Enter any combination of dates except for ones that contain
"08/01-31/07", it works fine, HELP!
Bill