Pre-weekending seems to have had an adverse effect on my mental faculties! I've got a table that contains quantities and prices:
QTY PRICE
400 12.00
600 10.00
1000 9.00
1500 8.00
2500 7.50
5000 7.00
I need to do is write a query that will get the price for a user-specified quantity that's within a range, something like this:
And that's where I lose it. 500 is > 400, but < 600, so what I need to do is get the 12.00 as my price, but I'm totally blocked at how to pull it off.
I know I'm going to kick myself when someone posts the answer!
< M!ke >
QTY PRICE
400 12.00
600 10.00
1000 9.00
1500 8.00
2500 7.50
5000 7.00
I need to do is write a query that will get the price for a user-specified quantity that's within a range, something like this:
Code:
SELECT (price * 500) AS EstCost
FROM tablename
WHERE quantity...
I know I'm going to kick myself when someone posts the answer!
< M!ke >