fboehlandt
Registered User.
- Local time
- Today, 23:56
- Joined
- Sep 5, 2008
- Messages
- 90
Hi everyone,
I have a problem with one of my queries. I have two normalized tables (PerformanceA, PerformanceB) containing the performance of various investment funds. Both tables have the same fields:
[Fundname] [Fundcode] [Date] [Return]
Obviously, one fund may have many return observations. In order to extract funds that have continuous track records between two dates I have come up with the following search query:
SELECT PerformanceA.*
FROM PerformanceA
WHERE PerformanceA.Code IN (
SELECT PerformanceA.Code
FROM PerformanceA
WHERE PerformanceA.Code IN (
SELECT PerformanceA.Code
FROM PerformanceA
WHERE PerformanceA.MM_DD_YYYY=#7/1/2000#)
AND PerformanceA.MM_DD_YYYY=#6/1/2005#);
Note that the dates are passed on from a userform in Excel. Thus, I have to use this rather complicated query for an otherwise simple search. Also, I have greatly simplified the actual query. Suffices to say, the above query works fine for both tables 'PerformanceA' and 'PerfromanceB'. However, if I run a UNION query to join the two tables first and then rerun the above query on the resulting table, the following happens: The query appears to be solving quickly (according to the query running bar) and then suddenly stops about 2/3 of the way through. It appears as if the query starts running over and over again. Additionally, if I trigger the query from Excel as part of a data connection (query in command text), I get the results that I want. I'm not sure but I think this query used ti run in the past - I have made some minor changes since, though. What could be the reason for this? Maybe some tables are corrupt? I really don't understand, any help is appreciated!
I have a problem with one of my queries. I have two normalized tables (PerformanceA, PerformanceB) containing the performance of various investment funds. Both tables have the same fields:
[Fundname] [Fundcode] [Date] [Return]
Obviously, one fund may have many return observations. In order to extract funds that have continuous track records between two dates I have come up with the following search query:
SELECT PerformanceA.*
FROM PerformanceA
WHERE PerformanceA.Code IN (
SELECT PerformanceA.Code
FROM PerformanceA
WHERE PerformanceA.Code IN (
SELECT PerformanceA.Code
FROM PerformanceA
WHERE PerformanceA.MM_DD_YYYY=#7/1/2000#)
AND PerformanceA.MM_DD_YYYY=#6/1/2005#);
Note that the dates are passed on from a userform in Excel. Thus, I have to use this rather complicated query for an otherwise simple search. Also, I have greatly simplified the actual query. Suffices to say, the above query works fine for both tables 'PerformanceA' and 'PerfromanceB'. However, if I run a UNION query to join the two tables first and then rerun the above query on the resulting table, the following happens: The query appears to be solving quickly (according to the query running bar) and then suddenly stops about 2/3 of the way through. It appears as if the query starts running over and over again. Additionally, if I trigger the query from Excel as part of a data connection (query in command text), I get the results that I want. I'm not sure but I think this query used ti run in the past - I have made some minor changes since, though. What could be the reason for this? Maybe some tables are corrupt? I really don't understand, any help is appreciated!