[ic] mv_sql_query question

Dennis Chen interchange-users@icdevgroup.org
Fri Dec 20 10:40:01 2002


Hi all,

We have a pretty weird "price" situation as it's caculated on the fly from
the listunitprice*discount_pct
so there is no actual price field.  I'm trying to do a range search with

	<input type=text name=min >
	<input type=text name=max >
	<input type=hidden name=mv_sql_query value="
	  SELECT sku
  	  FROM products
	  where (listunitprice*discount_pct) > min
	  and (listunitprice*discount_pct) < max">

but this does not seem to work as it gives me a "Bad SQL" error on the
screen.  I found out the error is caused by the ( ) in the statment.  Anyway
get around this besides creating a new price field?  It works fine when I
run the query in mysql.

Thanks
Dennis