Forum Discussion

HassanI's avatar
HassanI
Frequent Visitor
8 years ago

Return exchange rate based on date

Hi,

 

I have two tables, a sales table and a currency exchange table.

 

The exchange table has a fixed exchange rate per currency per year. With columns - Country, currency code, 2017 rate, 2018 rate, 2019 rate.

The sales table also has a country column and date column - the two tables are related through the country column.

For each row in the sales table, I want to check the [year] within date column and the country column and return the exchange rate for that year and country from one of the columns in the currency exchange table.

 

What is the solution to this, I need a solution that can be easily adjustable as further year rates, like 2020 rate, is added to the currency exchange table.