I have the following tables:
Products
product, idcurrency, value
Prod1 1 5000
Prod2 2 3000
Prod3 3 2000
Currrency
idcurrency, currencyID
1 EUR
2 USD
3 DKK
ForexExchange
idforexExchange providername, idbaseCurrency, isActive
1 XE Eur 1
2 provider2 DKK 1
ForexRates
idForexRates idforexExchange, toCurrency, exchangeRate
1 1 AED 2.3
2 1 EGY 1.3
3 1 GBP 2.4
4 2 AED 7.3
5 3 EGY 6.4
6 4 GBP 3.4
I want to get all the products in USD dollar for the active currency.
-all the currency filed related to the lookup table Currrency -we have forexexchange table so if we have multiple providers for the exchange rates we get the currencies rates for every exchange according to the base currency
-the forexrate table save the rates for every exchange
-we can set the active exchange from isActive so this exchange rates table will be used in the system
Expected Results
product Value ValueUSD
prod1 5000 25000
...............