D
DAnte
I have created a database that contains a main table that
has a many-to-many relationship with two other tables. I
am trying to create a query that consists of pretty much
all of the data in the data base, but I can't seem to get
all of the data to display. When I do a query based on
the first many-to-many relationship it works fine and the
SQL looks like below
SELECT tblInputFiles.InputNum, tblInputFiles.Portfolio,
tblInputFiles.AppNum, tblInputFiles.Application,
tblInputFiles.AppType, tblInputFiles.FileName,
tblInputFiles.UploadSnumb, tblInputFiles.DownloadSnumb,
tblInputFiles.FieldName, tblInputFiles.FieldType,
tblInputFiles.FieldLength, tblInputFiles.Frequency,
tblInputParentLink.InputNum, tblInputParentLink.PFileNum,
tblSysSourcePTFile.ParentFileName
FROM tblSysSourcePTFile INNER JOIN (tblInputFiles INNER
JOIN tblInputParentLink ON tblInputFiles.InputNum =
tblInputParentLink.InputNum) ON
tblSysSourcePTFile.PFileNum = tblInputParentLink.PFileNum;
But when I add the tables that are part of the second many-
to-many relationship I don't get any results and the SQL
in the FROM portion of the code looks like this
FROM tblSysSourceDbase INNER JOIN ((tblSysSourcePTFile
INNER JOIN (tblInputFiles INNER JOIN tblInputParentLink ON
[tblInputFiles].[InputNum]=[tblInputParentLink].
[InputNum]) ON [tblSysSourcePTFile].[PFileNum]=
[tblInputParentLink].[PFileNum]) INNER JOIN
tblInputDBaseLink ON [tblInputFiles].[InputNum]=
[tblInputDBaseLink].[InputNum]) ON [tblSysSourceDbase].
[DBFfieldNum]=[tblInputDBaseLink].[DBFieldNum];
Here are the relationships in the database
tblInputFiles---One-To-Many---tblInputParentLink
tblSysSourcePTFile---One-To_Many---tblInputParentLink
tblInputFile---One-To-Many---tblInputDBaseLink
tblSysSourceDbase---One-To-Many-tblInputDbaseLink
I am not terribly familiar with the SQL syntax in access
so dealing with joins is extremely confusing. Does any
one know if it is possible to do what I am doing? What
can I do to pull records from all three tables at the same
time?
has a many-to-many relationship with two other tables. I
am trying to create a query that consists of pretty much
all of the data in the data base, but I can't seem to get
all of the data to display. When I do a query based on
the first many-to-many relationship it works fine and the
SQL looks like below
SELECT tblInputFiles.InputNum, tblInputFiles.Portfolio,
tblInputFiles.AppNum, tblInputFiles.Application,
tblInputFiles.AppType, tblInputFiles.FileName,
tblInputFiles.UploadSnumb, tblInputFiles.DownloadSnumb,
tblInputFiles.FieldName, tblInputFiles.FieldType,
tblInputFiles.FieldLength, tblInputFiles.Frequency,
tblInputParentLink.InputNum, tblInputParentLink.PFileNum,
tblSysSourcePTFile.ParentFileName
FROM tblSysSourcePTFile INNER JOIN (tblInputFiles INNER
JOIN tblInputParentLink ON tblInputFiles.InputNum =
tblInputParentLink.InputNum) ON
tblSysSourcePTFile.PFileNum = tblInputParentLink.PFileNum;
But when I add the tables that are part of the second many-
to-many relationship I don't get any results and the SQL
in the FROM portion of the code looks like this
FROM tblSysSourceDbase INNER JOIN ((tblSysSourcePTFile
INNER JOIN (tblInputFiles INNER JOIN tblInputParentLink ON
[tblInputFiles].[InputNum]=[tblInputParentLink].
[InputNum]) ON [tblSysSourcePTFile].[PFileNum]=
[tblInputParentLink].[PFileNum]) INNER JOIN
tblInputDBaseLink ON [tblInputFiles].[InputNum]=
[tblInputDBaseLink].[InputNum]) ON [tblSysSourceDbase].
[DBFfieldNum]=[tblInputDBaseLink].[DBFieldNum];
Here are the relationships in the database
tblInputFiles---One-To-Many---tblInputParentLink
tblSysSourcePTFile---One-To_Many---tblInputParentLink
tblInputFile---One-To-Many---tblInputDBaseLink
tblSysSourceDbase---One-To-Many-tblInputDbaseLink
I am not terribly familiar with the SQL syntax in access
so dealing with joins is extremely confusing. Does any
one know if it is possible to do what I am doing? What
can I do to pull records from all three tables at the same
time?