R
ryguy7272
I’m using the below SQL, which works perfectly well. I’m trying to figure
out a way to add in a little calculation for mutual fund returns for 1-month,
3-months, 6-months, and 12-months. I am thinking I would need to prompt the
user for a date, and then do the calculations based on that. It wouldn’t
necessarily be today’s date, but a date the user chooses, minus 21-days
(assuming 21 days in a trading month), 63-days, 125-days, and 250-days
(assuming there are 260-days in a trading year, minus 9 holidays).
How can I incorporate this logic into my current query? I originally
proposed this question a couple weeks ago, but haven’t been able to devote
any time to I until just now. When I first posted this question, I received
a response that said I may need to create 4 separate queries, and then pull
all results into one final query.
Here is the SQL that I’m working with right now:
SELECT SharePrices.DateTime, SharePrices.StockSymbol,
SharePrices.StockPrice, tblStocksGroup.Company, tblStocksGroup.HDVest50k,
tblStocksGroup.HDVest100k, tblStocksGroup.ETF, tblStocksGroup.NetJets,
tblStocksGroup.JetBlue
FROM SharePrices INNER JOIN tblStocksGroup ON SharePrices.StockSymbol =
tblStocksGroup.Ticker
WHERE (((SharePrices.DateTime) Between [Forms]![frmMstr]![cboFrom] And
[Forms]![frmMstr]![cboTo]) AND
((tblStocksGroup.HDVest50k)=[Forms]![frmMstr]![chkHDVest50k]) AND
((tblStocksGroup.HDVest100k)=[Forms]![frmMstr]![chkHDVest100k]) AND
((tblStocksGroup.ETF)=[Forms]![frmMstr]![chkETF]) AND
((tblStocksGroup.NetJets)=[Forms]![frmMstr]![chkNetJets]) AND
((tblStocksGroup.JetBlue)=[Forms]![frmMstr]![chkJetBlue]))
ORDER BY SharePrices.DateTime;
TIA!!!
Ryan--
out a way to add in a little calculation for mutual fund returns for 1-month,
3-months, 6-months, and 12-months. I am thinking I would need to prompt the
user for a date, and then do the calculations based on that. It wouldn’t
necessarily be today’s date, but a date the user chooses, minus 21-days
(assuming 21 days in a trading month), 63-days, 125-days, and 250-days
(assuming there are 260-days in a trading year, minus 9 holidays).
How can I incorporate this logic into my current query? I originally
proposed this question a couple weeks ago, but haven’t been able to devote
any time to I until just now. When I first posted this question, I received
a response that said I may need to create 4 separate queries, and then pull
all results into one final query.
Here is the SQL that I’m working with right now:
SELECT SharePrices.DateTime, SharePrices.StockSymbol,
SharePrices.StockPrice, tblStocksGroup.Company, tblStocksGroup.HDVest50k,
tblStocksGroup.HDVest100k, tblStocksGroup.ETF, tblStocksGroup.NetJets,
tblStocksGroup.JetBlue
FROM SharePrices INNER JOIN tblStocksGroup ON SharePrices.StockSymbol =
tblStocksGroup.Ticker
WHERE (((SharePrices.DateTime) Between [Forms]![frmMstr]![cboFrom] And
[Forms]![frmMstr]![cboTo]) AND
((tblStocksGroup.HDVest50k)=[Forms]![frmMstr]![chkHDVest50k]) AND
((tblStocksGroup.HDVest100k)=[Forms]![frmMstr]![chkHDVest100k]) AND
((tblStocksGroup.ETF)=[Forms]![frmMstr]![chkETF]) AND
((tblStocksGroup.NetJets)=[Forms]![frmMstr]![chkNetJets]) AND
((tblStocksGroup.JetBlue)=[Forms]![frmMstr]![chkJetBlue]))
ORDER BY SharePrices.DateTime;
TIA!!!
Ryan--