A
Aaron
My issue is trying to get nested joins to work in Access. I'm open to
any suggestion that will work however I cannot alter the data
structure.
First of all, in order to get the data I need, I have to match three
ID fields as there is no unique field so to join the first two tables
I have to do this: (Code is generated by Access)
SELECT OARentRoll.PropID, OARentRoll.VersionID,
OAMarketLeasing.PropID, OAMarketLeasing.VersionID,
OARentRoll.TenantID, OARentRoll.BaseRentDetailID,
OARentRoll.ReimbursementID, OARentRoll.AbatementID,
OAMarketLeasing.VersionID
FROM OARentRoll LEFT JOIN OAMarketLeasing ON OARentRoll.MarketID =
OAMarketLeasing.MLAID
WHERE (((OARentRoll.PropID)=[GetPropID])
AND ((OARentRoll.VersionID)=[GetVersionID])
AND ((OAMarketLeasing.PropID)=[OARentRoll].[PropID])
AND ((OAMarketLeasing.VersionID)=[OARentRoll].[VersionID]));
I've joined the OaRentroll table and the OAMarketLeasing table on
PropID, Version ID and MarketID. The left join on MarketID is so
thatALL matching OARentroll records are included even if they dont
have a MarketID.
I need to bring in one additional table for each of the ID fields in
the select statement (TenantID, BaseRentDetailID, etc) and do the
three field join for each of those
(OARentRoll.PropID=BaseRentTable.PropID AND
OARentRoll.VersionID=BaseRentTable.VersionID AND
OARentRoll.BaseRentDetailID=BaseRentTable.BaseRentID)
Each of those additional joins has to be ALL records from OARentRoll
and only those fields from addtional tables where joined fields are
equal.
Can I continue this pattern and bring in 5 or 6 additional tables
showing 3 or 4 fields from each table? Does every field from every
table need to be listed in the first Select statement?
Thanks very much!
any suggestion that will work however I cannot alter the data
structure.
First of all, in order to get the data I need, I have to match three
ID fields as there is no unique field so to join the first two tables
I have to do this: (Code is generated by Access)
SELECT OARentRoll.PropID, OARentRoll.VersionID,
OAMarketLeasing.PropID, OAMarketLeasing.VersionID,
OARentRoll.TenantID, OARentRoll.BaseRentDetailID,
OARentRoll.ReimbursementID, OARentRoll.AbatementID,
OAMarketLeasing.VersionID
FROM OARentRoll LEFT JOIN OAMarketLeasing ON OARentRoll.MarketID =
OAMarketLeasing.MLAID
WHERE (((OARentRoll.PropID)=[GetPropID])
AND ((OARentRoll.VersionID)=[GetVersionID])
AND ((OAMarketLeasing.PropID)=[OARentRoll].[PropID])
AND ((OAMarketLeasing.VersionID)=[OARentRoll].[VersionID]));
I've joined the OaRentroll table and the OAMarketLeasing table on
PropID, Version ID and MarketID. The left join on MarketID is so
thatALL matching OARentroll records are included even if they dont
have a MarketID.
I need to bring in one additional table for each of the ID fields in
the select statement (TenantID, BaseRentDetailID, etc) and do the
three field join for each of those
(OARentRoll.PropID=BaseRentTable.PropID AND
OARentRoll.VersionID=BaseRentTable.VersionID AND
OARentRoll.BaseRentDetailID=BaseRentTable.BaseRentID)
Each of those additional joins has to be ALL records from OARentRoll
and only those fields from addtional tables where joined fields are
equal.
Can I continue this pattern and bring in 5 or 6 additional tables
showing 3 or 4 fields from each table? Does every field from every
table need to be listed in the first Select statement?
Thanks very much!