I have the following database table:
COL-A COL-B
1 $200
2 $100
4 $50
5 $40
What i need to do is if i have the value 1.5, i need to find the two numbers that fall between it, so that would be 1 and 2.
I need the values to input into a linear equation for a pricing calculator that i am working on.
The values may not always be the same, so it could even be like so:
COL-A COL-B
1 $200
6 $100
11 $50
22 $40
If i had 9, i would then to return both 6 and 11 as 9 falls between those two values, etc etc
Visualising this i would need them put into seperate variables:
double Min = the_lowest_value;
double Max = the_highest_value;
I am using EF to do this, so it would need to be in LINQ.
6return in the second table?