fboehlandt
Registered User.
- Local time
- Today, 19:14
- Joined
- Sep 5, 2008
- Messages
- 90
Hi everyone,
I have the following three tables in my database:
ADMIN.
I have the following three tables in my database:
ADMIN.
Code:
,[Name],[Country]
PERFORMANCE.[Code],[Name],[Date],[Return]
ASSETS.[Code],[Name],[Date],[Assets]
The first table contains general information about an investment fund, the primary key is Code (unique). The other two tables contain performance data (returns and assets-under-management) for different dates. The primary keys for both are composite keys ([Name]-[Date]). The combinations are unique. The relationship is one-to-many between ADMIN and PERFORMANCE and ADMIN and ASSETS respectively. [Code] is the foreign key in the two child tables.
I would like to run a search query that combines the information of the three databases. So far, I can combine ADMIN with PERFORMANCE or ADMIN with ASSETS, but not all three. PERFORMANCE contains shlightly more datapoints than ASSETS does (I expect that this causes some problems). I want my query to look like this:
[Code],[Name],[Country],[Date],[Return],[Assets]
Code1, Name1, Country1, Date1, Return1, Assets1
Code1, Name1, Country1, Date2, Return2, Assets2
Code1, Name1, Country1, Date3, Return3, Assets3
Code2, Name2, Country2, Date1, Return1, Assets1
Code2, Name2, Country2, Date2, Return2, Assets2
Code2, Name2, Country2, Date3, Return3, Assets3
etc.
Where nothing is displayed in an Assets field when Return datapoint exists but Assets entry does not.
The query gives me:
Code1, Name1, Country1, Date1, Return1, Assets1
Code1, Name1, Country1, Date2, Return1, Assets2
Code1, Name1, Country1, Date3, Return1, Assets3
Code1, Name1, Country1, Date1, Return2, Assets1
Code1, Name1, Country1, Date2, Return2, Assets2
Code1, Name1, Country1, Date3, Return2, Assets3
Code1, Name1, Country1, Date1, Return3, Assets1
Code1, Name1, Country1, Date2, Return3, Assets2
Code1, Name1, Country1, Date3, Return3, Assets3
etc.
Can anyone help?
Thanks
Florian