You didn't mention which DB system you're using. The functions might be
different from DB to DB. I used SQL Server as my base so YMMV.
Using CF code as an example you should get multiples of the price for each
grouping less than or equal to the minimum quantity:
<cfset cart = 4>
<cfset min = 5>
<cfset price = 12>
<cfoutput>
#Fix(price * CEILING(cart/ min) )#
</cfoutput>
So for 1-5, you'd have 1 * 12, for 6-10 you'd have 2 * 12, 11-15 you'd have
3 * 12, etc.
That should carry over to the query as well.
-----Original Message-----
From: Mike Little [mailto:[email protected]]
Sent: Wednesday, May 05, 2010 9:36 PM
To: cf-talk
Subject: Re: query for experts?
azadi - your query works for a qty of 4 but not anything between 5 and 10.
rick - not possible as qty's range massively per product type
andy - cannot get this query to work, outputs wrong price
maureen - was just an example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:333374
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm