fboehlandt
Registered User.
- Local time
- Today, 12:19
- Joined
- Sep 5, 2008
- Messages
- 90
Hi everyone,
I have the following table named 'information' that contains the names and codes of investment funds in two fields:
<Name> <Code>
Name1 Code1
Name2 Code2
...
NameN CodeN
A separate normalized table 'performance' contains the performance of said funds:
<Name> <Code> <MM_DD_YYYY> <Return>
Name1 Code1 Date1 Return1
Name1 Code1 Date2 Return2
...
Name1 Code1 DateM ReturnM
Name2 Code2 Date1 Return1
Name2 Code2 Date2 Return2
...
Name2 Code2 DateM ReturnM
mutatis mutandi for all other funds until Fund N
Although all funds contain the same number of return observations (i.e. the same number of distinct dates), some of those observations contain empty values. I would like to run a query that includes funds with complete performance history only. This is what I have so far:
The dates are arbitrarily chosen. Thus for #12/1/1997# to #1/1/1998#: HAVING Count(*) = 122 etc...The actual problem is that the number of observations per fund are = 121 regardless of whether a fund reported performance in the given month or not (i.i. empty field values count). Thus, I'm not sure whether Count(*) is the appropriate arithmetic function here but don't know what else to use. Can anyone help please?
I have the following table named 'information' that contains the names and codes of investment funds in two fields:
<Name> <Code>
Name1 Code1
Name2 Code2
...
NameN CodeN
A separate normalized table 'performance' contains the performance of said funds:
<Name> <Code> <MM_DD_YYYY> <Return>
Name1 Code1 Date1 Return1
Name1 Code1 Date2 Return2
...
Name1 Code1 DateM ReturnM
Name2 Code2 Date1 Return1
Name2 Code2 Date2 Return2
...
Name2 Code2 DateM ReturnM
mutatis mutandi for all other funds until Fund N
Although all funds contain the same number of return observations (i.e. the same number of distinct dates), some of those observations contain empty values. I would like to run a query that includes funds with complete performance history only. This is what I have so far:
Code:
SELECT Information.Code
FROM Information INNER JOIN Performance
ON Information.Code = Performance.Code
WHERE Performance.MM_DD_YYYY>=#1/1/1998# And Performance.MM_DD_YYYY<=#1/1/2008#
GROUP BY Information.Code
HAVING Count(*)=121));
The dates are arbitrarily chosen. Thus for #12/1/1997# to #1/1/1998#: HAVING Count(*) = 122 etc...The actual problem is that the number of observations per fund are = 121 regardless of whether a fund reported performance in the given month or not (i.i. empty field values count). Thus, I'm not sure whether Count(*) is the appropriate arithmetic function here but don't know what else to use. Can anyone help please?