firefly2k8
Registered User.
- Local time
- Today, 04:57
- Joined
- Nov 18, 2010
- Messages
- 48
I have the following query which nicely calculates the standard deviation from my table TSTable where the dates are within a given range and the currency is as defined:
I originally wrote:
and Access added the alias bit. Not sure why.
Now I have another table, PTable which has amongst other fields the following:
TradeDate, CurrencyPair, ProjectID, vol_result
For each record in PTable I want to run my above query using the TradeDate and TradeDate+1 for the Date_Time between and the CurrencyPair for the Pair. I would like to put output of the query in vol_result.
I am thinking along the lines of UPDATE, INNER JOIN. But basically, how would I do this?
Thank you in advance for any help.
Code:
SELECT STDEV(vol)
FROM [SELECT (High+Low)/2 AS vol
FROM TSTable
WHERE (Date_Time Between #6/2/2011# And #6/3/2011#) And Pair="GBPUSD"
]. AS [%$##@_Alias];
Code:
SELECT STDEV(vol)
FROM (SELECT (High+Low)/2 AS vol
FROM TSTable
WHERE (Date_Time Between #6/2/2011# And #6/3/2011#) And Pair="GBPUSD");
Now I have another table, PTable which has amongst other fields the following:
TradeDate, CurrencyPair, ProjectID, vol_result
For each record in PTable I want to run my above query using the TradeDate and TradeDate+1 for the Date_Time between and the CurrencyPair for the Pair. I would like to put output of the query in vol_result.
I am thinking along the lines of UPDATE, INNER JOIN. But basically, how would I do this?
Thank you in advance for any help.