Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Apples
Posting Yak Master
146 Posts |
Posted - 2008-02-07 : 16:38:59
|
| Here's my table:---------------------Policies | Premiums---------------------10000 | 22910500 | 23311000 | 23511500 | 239...and so on...The user enters a policy amount, and based on that amount, it gives the premium amount. The way it works is if they enter a number in between the policies, say 11300, it will give the next highest premium, which would be 239 in that case.How can I implement that procedure? I thought about just incrementing the user input until it is found, but that could get very tedious. |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-02-07 : 16:45:09
|
| how about:select min(premiums) from <table> where Policies >= @pBe One with the OptimizerTG |
 |
|
|
|
|
|