Forums

This topic is locked

selecting from

Posted 21 Nov 2002 04:04:09
1
has voted
21 Nov 2002 04:04:09 alice alice posted:
I have two tables ... one contains a product price, the other contains a margin bracket and the relevant percentage

margin | margin_percent
-----------------------------
0 | 0%
500 | 5%
800 | 10%
1000 | 15%

What I need is for a price to be between assigned a percentage based upon where it fits between the brackets.

ie: <i>if the price is 700, it would fall between 500 and 800 therefore its percentage would be 5%, or if the price is 1000 or more it would be 15%</i>

Is there a way to do this? ive experimented with the between operater and iif, but cant get the work right atm.

Any help would be most appreciated

Reply to this topic