Find a value in a table based on a date

Based on a date, I must search a table for a value from another column, but the date is not necessarily exact, it can be within a range or be greater than the last one in the table.

For example

VUT - Table

|Since |Value|
| 19/02/2014 | 127 |
| 25/02/2015 | 150 |
| 11/02/2016 | 177 |
| 25/02/2017 | 300 |

Depending on the date of a transaction, I must take the value of the โ€œValueโ€ field and perform a calculation, but the date of the transaction can be anyone and not necessarily the one specified in the table, each record establishes a range and must take the "Value "depending on where you are

I would appreciate your comments.

Solved Solved
0 6 570
1 ACCEPTED SOLUTION

Have to change MIX to MAX on the SELECT โ€ฆ the list for this SELECT takes the rows where Dates ar greater and equal to Since โ€ฆ but the closest Since is the MAX

View solution in original post

6 REPLIES 6
Top Labels in this Space