I have created form where the values are taken from the form. I still get and an error when I put my form value in the statement. But when I run the statement separately it works but now when I combine it doesn't.
<cfif not isdefined("Form.frmpricerange")>
<cfset Form.frmpricerange = "N">
</cfif>
<CFQUERY NAME="stuff" DATASOURCE="xxxxxx">
Select *
FROM (people LEFT JOIN Cities ON City = Cities.palce) LEFT JOIN Check ON people.Code = Check.Code
WHERE (((Check.Date)>=#9/6/2011# And (Check.Date)<>#8/31/2011#)
HAVING (((Deal)=Yes) AND ((Webpage)=1) AND ((Date)>=#9/6/2011#) AND ((Released)=Yes) AND ((People.Price) Between <cfif #Form.pricerange# eq 5000 ><cfoutput>1</cfoutput></cfif> AND 30000))
ORDER BY People.Price_from;
</CFQUERY>
<form method="post" name="frmpricerange">
<select name="pricerange" id="pricerange" style="height:19px">
<option value="0">Search By Price Range</option>
<option value="5000">0 - 5 000</option>
<option value="10000">5 000 -10 000</option>
<option value="20000">10 000 - 20 000</option>
<option value="50000">20 000 - 50 000</option>
</select>
<input name="Check" type="submit" />
</form>
Please help scratching my head :-/