G
Guest
I’m having a problem joining three tables into one query. I can join the
Investment Table and the Fund Table but when I try to add the Institution
Table and run the query it comes back blank. Here are the details:
Table Funds:
Fund Number (primary key)
Fund Name
Table Institutions:
Institution Name (primary key)
Days to Use
Table Investments:
Investment Number (primary key)
Safekeeping Number
Institution Name
Fund Number
Face Amount
Interest Rate
Other Interest
Purchase Date
Maturity Date
The SQL for the two that join together OK is:
SELECT funds.[Fund Number], funds.[Fund Name], Investments.[Investment
Number], Investments.[Safekeeping Number], Investments.[Institution Name],
Investments.[Face Amount], Investments.[Interest Rate], Investments.[Other
Interest], Investments.[Purchase Date], Investments.[Maturity Date]
FROM funds INNER JOIN Investments ON funds.[Fund Number] = Investments.[Fund
Number];
The SQL when I add the Institution table is:
SELECT funds.[Fund Number], funds.[Fund Name], Investments.[Investment
Number], Investments.[Safekeeping Number], Investments.[Institution Name],
Investments.[Face Amount], Investments.[Interest Rate], Investments.[Other
Interest], Investments.[Purchase Date], Investments.[Maturity Date]
FROM Institutions INNER JOIN (funds INNER JOIN Investments ON funds.[Fund
Number] = Investments.[Fund Number]) ON Institutions.[Institution Name] =
Investments.[Institution Name];
I am pretty much self taught and haven’t focused to much on the SQL yet so
I’m hoping that somebody can look at this and explain to me what I’m doing
wrong.
Thanks,
Sue
Investment Table and the Fund Table but when I try to add the Institution
Table and run the query it comes back blank. Here are the details:
Table Funds:
Fund Number (primary key)
Fund Name
Table Institutions:
Institution Name (primary key)
Days to Use
Table Investments:
Investment Number (primary key)
Safekeeping Number
Institution Name
Fund Number
Face Amount
Interest Rate
Other Interest
Purchase Date
Maturity Date
The SQL for the two that join together OK is:
SELECT funds.[Fund Number], funds.[Fund Name], Investments.[Investment
Number], Investments.[Safekeeping Number], Investments.[Institution Name],
Investments.[Face Amount], Investments.[Interest Rate], Investments.[Other
Interest], Investments.[Purchase Date], Investments.[Maturity Date]
FROM funds INNER JOIN Investments ON funds.[Fund Number] = Investments.[Fund
Number];
The SQL when I add the Institution table is:
SELECT funds.[Fund Number], funds.[Fund Name], Investments.[Investment
Number], Investments.[Safekeeping Number], Investments.[Institution Name],
Investments.[Face Amount], Investments.[Interest Rate], Investments.[Other
Interest], Investments.[Purchase Date], Investments.[Maturity Date]
FROM Institutions INNER JOIN (funds INNER JOIN Investments ON funds.[Fund
Number] = Investments.[Fund Number]) ON Institutions.[Institution Name] =
Investments.[Institution Name];
I am pretty much self taught and haven’t focused to much on the SQL yet so
I’m hoping that somebody can look at this and explain to me what I’m doing
wrong.
Thanks,
Sue