just to clarify:
i am assuming your price is applicable to min_qty or less, i.e.
5 : $12.00 = price is $12 for 5 or less items
10 : $11.55 = price is $11.55 for 6-10 items

am i wrong in my assumption? (maybe that's why you said my query did not
work...)

Azadi

On 06/05/2010 11:29, Azadi Saryev wrote:
>  On 06/05/2010 10:36, Mike Little wrote:
>> azadi - your query works for a qty of 4 but not anything between 5 and 10
> that's strange...
> this works fine for me in MySQL:
> SELECT price
> FROM ...
> WHERE min_qty >= 8
> ORDER BY (min_qty/8)
> LIMIT 1
>
> the only difference to MS SQL is using TOP 1 instead of LIMIT 1...
>
> what is the data types of your min_qty column? could it be some type
> conversion happening in (min_qty/X) part?
> are you sure you changed #somevalue# to correct value in both instances
> in the query when you tested?
>
> Azadi

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333378
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to