It shows no message just says page not found
If you're using IE, it's probably a badly worded error message. Turn off it's friendly error messages or you won't be able to view the real error http://malektips.com/internet-explorer-8-disable-friendly-error-messages.html
but when I remove the between clause it seems to work
That's because your code isn't generating a valid SQL statement. You're not doing anything when Form.pricerange# is NOT equal to 5000. So your sql is incomplete:
AND ((People.Price) Between {there should be something here})
WHERE (((Check.Date)>=#9/6/2011# And (Check.Date)<>#8/31/2011#)
But overall the query doesn't make sense. There's a lot of contradictory and redundant conditions. Let's step back and figure out what you're trying to do in plain english 1st. Then we can help you put it into SQL.
A few small tips:
- Don't use Access specific syntax for dates ie #9/6/2011# . It's not portable. Better to use cfqueryparam or CreateODBCDate instead.
- A HAVING clause is only needed for aggregates. You're not using any. So all of those conditions belong in the WHERE clause instead