1). I wouldn't use session scope variables in a query
2) Use between in the SQL , e.g.:
where Request.Total BETWEEN shipfrom AND shipto
3). Display the variables and the records returned.... might be a surprise if
you look at the data
HTH
Dick
At 4:01 PM -0400 5/11/01, ibtoad wrote:
>Does anyone see any problems with the following query:
>
><cfquery name="get_shipratedollars" datasource="#config.datasource#">
>Select shiprate from shipratesdollars
>WHERE '#session.total#' >= shipfrom
>and '#session.total#' <= shipto
></cfquery>
>
>
>I can not figure out why I am getting incorrect results. Sometimes it will
>pull more than one record and sometimes it will pull the max record only.
>Here is a copy of the table I am using named shipratedollars.
>
>ID shiprate shipfrom shipto
>1 4.00 0.00 50.00
>2 6.00 50.01 100.00
>3 8.00 100.01 200.00
>4 12.00 200.01 300.00
>5 18.00 300.01 500.00
>6 25.00 500.01 750.00
>7 40.00 750.01 1000.00
>8 50.00 1000.01 1500.00
>9 70.00 1500.01 2000.00
>10 100.00 2000.00 99999.00
>
>
>Thansk,
>Rich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists