I need to narrow down a result set based on a number.
I can't explain it well in words, but please read on... the queries/code should tell all.
<!--- Pricing Structure based on quantity levels --->
<cfquery name="GetPricing" datasource="secret">
SELECT *
FROM pricing_table
WHERE product = 'widget'
</cfquery>
<!--- Final Order Pricing dependent on SUM of Company's group order --->
<cfquery name="GetCurrentWidgetOrders" datasource="secret">
SELECT SUM(quantity) AS CurrentQty
FROM orders_table
WHERE product = 'widget'
</cfquery>
Display Pricing Table to user with current Group Order Pricing Row highlighted:
<cfoutput query="GetPricing">
<tr><td>#Qty#</td><td>#UnitPrice#</td></tr>
</cfoutput>
Qty UnitPrice
100 10
250 8
500 6
1000 5
NOW, assume that the group order total is currently at a quantity of 550. How do I get only the 500 row to receive a <tr bgcolor="yellow"> and not the others?
I can't explain it well in words, but please read on... the queries/code should tell all.
<!--- Pricing Structure based on quantity levels --->
<cfquery name="GetPricing" datasource="secret">
SELECT *
FROM pricing_table
WHERE product = 'widget'
</cfquery>
<!--- Final Order Pricing dependent on SUM of Company's group order --->
<cfquery name="GetCurrentWidgetOrders" datasource="secret">
SELECT SUM(quantity) AS CurrentQty
FROM orders_table
WHERE product = 'widget'
</cfquery>
Display Pricing Table to user with current Group Order Pricing Row highlighted:
<cfoutput query="GetPricing">
<tr><td>#Qty#</td><td>#UnitPrice#</td></tr>
</cfoutput>
Qty UnitPrice
100 10
250 8
500 6
1000 5
NOW, assume that the group order total is currently at a quantity of 550. How do I get only the 500 row to receive a <tr bgcolor="yellow"> and not the others?