S
supicek
Hi I would appriciate if somebody can help me with the following query:
tbDeliveryLines
- dlID
- dlDate
- dlCurrencyID
- dlQTY
- dlUnitPrice
tbExchangeRates
- erID
- erCurrencyID
- erValidFrom
- erFXRate
I would like to build a query which would return all my delivery lines +
lookup a valid FX rate from tbExchangeRates for a entered curreny
(dlCurrencyID) and date (dlDate)
Example:
tbExchangeRates
erID, erCurrencyID, erValidFrom, erFXRate
1, 1, 01-JAN-2010, 31
2, 1, 01-FEB-2010, 32
3, 1, 01-MAR-2010, 33
4, 2, 01-MAR-2010, 50
Query should return:
dlDate, dlCurrencyID, erFXRate
15-JAN-2010, 1, 31
10-JUL-2010, 1, 33
10-JUL-2010, 2, 50
I think I should use SELECT in SELECT statement, but I am a bit lost in
this.Thank you for your help
supicek
tbDeliveryLines
- dlID
- dlDate
- dlCurrencyID
- dlQTY
- dlUnitPrice
tbExchangeRates
- erID
- erCurrencyID
- erValidFrom
- erFXRate
I would like to build a query which would return all my delivery lines +
lookup a valid FX rate from tbExchangeRates for a entered curreny
(dlCurrencyID) and date (dlDate)
Example:
tbExchangeRates
erID, erCurrencyID, erValidFrom, erFXRate
1, 1, 01-JAN-2010, 31
2, 1, 01-FEB-2010, 32
3, 1, 01-MAR-2010, 33
4, 2, 01-MAR-2010, 50
Query should return:
dlDate, dlCurrencyID, erFXRate
15-JAN-2010, 1, 31
10-JUL-2010, 1, 33
10-JUL-2010, 2, 50
I think I should use SELECT in SELECT statement, but I am a bit lost in
this.Thank you for your help
supicek