Querying value from a range of two values
I have patched together a shopping cart, operating on CF8, and am now trying to add shipping. The client wants the shipping charges based on the cost of item, ie:
0-$499 is $20
$500 – $999 is $25.00
$999 – up $45
I built an access table (simplified) with the following rows
Price_min, Price_max,ship_cost
The idea is to query the subtotal from the price_min and Price_max to determine the shipping cost:
<cfquery name="getInfo" datasource="#application.databasePRD#">
select ship_cost, price_min,price_max
from shipping
where price_min >= #form.subtotal# and price_max <= #form.subtotal#>
</cfquery>
</cfif>
<cfoutput query="getInfo">
#ship_cost#
</cfoutput>
Alas, I get the following error:
Syntax error (missing operator) in query expression ‘price_min >= 29 and price_max <= 29'.
What am I doing wrong?
