PDA

View Full Version : Extrpolate rates



philfer
02-02-2016, 06:22 AM
Hello,

If I have one table with number of days and interest rates :-

30 0.15
60 0.25

Than a table with transactions and number of days of the transaction :-

Loan 1 40 (days)

Is there a way to get access to extrapolate the rate for the loan using access or would I have to use VBA

Many thanks
Phil

ranman256
02-05-2016, 06:09 AM
vba.

philfer
02-06-2016, 05:39 AM
Hello,

Any ideas as to how I would do this in VBA. Somehow for 40 days I need to identify that I need the 30 day and 60 day rates to extrapolate. These two rates are not the only ones in the table so how would I get Access/VBA to recognise that I need the 30 day rate and the 60 day rate to extrapolate the 40 day rate

Many thanks
Phil

jonh
02-08-2016, 04:08 AM
You'd need to query the data whatever you do.


SELECT Avg(rate) AS AvgRate
FROM (
SELECT rate
FROM rates
WHERE
id In (select top 1 id from rates where days <=[Enter Number of Days])
Or
id In (select top 1 id from rates where days >=[Enter Number of Days])
)


Where the table is named rates and it holds fields id, days and rate.
[Enter Number of Days] asks the user for input.