List:General Discussion« Previous MessageNext Message »
From:Bokodán Gábor Date:September 11 2006 6:36am
Subject:Selecting exchange rates
View as plain text  
I have two tables, an exchange rate table, which has (edate 
date, currency char(3), rate decimal(8,2))  (each record is 
valid from edate) and a transactions table, which has (tdate 
date, amount decimal(10,2), currency char(3)).

I would like to select the correspondent exchange rates for 
all the transaction rows.  Exchange rate record is valid, if 
that is the latest (<=) compared to the transaction's date.

Please help me how to select it!

select transaction.tdate, transaction.amount, transaction.currency, exchange.rate .....

Thank you,

Bokodán Gábor

Selecting exchange ratesBokodán Gábor11 Sep