L
Lana
Hi all,
I got a table "tCorrespondence" where i have lots of combo-fields linked to
sub-tables.
Somebody told me to store the reference number (id from sub-table) but not
actual text in the fields of main table. Which i did, and all was fine with
Forms and Reports where i also used combo-boxes, - untill i came to a need to
have all values to be represented in 1 query as text fields (for output to a
Word template using mail-merge).
I successfully got data from main table and 1 sub-table, but when i try to
add more sub-tables, i get unexpected results.
I was making the query in the "Design view" and when i switched to SQL i saw
that
the function used is "INNER JOIN". May be it is wrong?
Please help!!!!
SELECT tCorrespondence.ID, tCorrespondence.IssueDate,
tCorrespondence.RecDelDate, tCorrespondence.Type, tCorrespondence.RefNo,
tCorrespondence.MeanOfDelivery, tCorrespondence.FromToClient,
tCorrespondence.Project, tCorrespondence.Subject, tCorrespondence.FiledAt,
tCorrespondence.PriceVND, tCorrespondence.DocType, tCorrespondence.FollowUp,
tContacts.CompID, tContacts.CompanyFullName, tContacts.BusinessStreet,
tContacts.BusinessCity, tContacts.BusinessCountry, tCorrespondence.ToPerson,
tCorrespondence.DHLNo, tCorrespondence.Comments,
tCorrespondence.PersonSigned, tCorrespondence.CommentsW
FROM tContacts INNER JOIN tCorrespondence ON tContacts.CompID =
tCorrespondence.FromToClient
WHERE (((tCorrespondence.Type)=2));
The above code works all right, but i need to introduce data from
"tContactPersons" and "tProjects" to replace there "IDs" stored in the main
table. How can i do that?
Thank you.
Lana
I got a table "tCorrespondence" where i have lots of combo-fields linked to
sub-tables.
Somebody told me to store the reference number (id from sub-table) but not
actual text in the fields of main table. Which i did, and all was fine with
Forms and Reports where i also used combo-boxes, - untill i came to a need to
have all values to be represented in 1 query as text fields (for output to a
Word template using mail-merge).
I successfully got data from main table and 1 sub-table, but when i try to
add more sub-tables, i get unexpected results.
I was making the query in the "Design view" and when i switched to SQL i saw
that
the function used is "INNER JOIN". May be it is wrong?
Please help!!!!
SELECT tCorrespondence.ID, tCorrespondence.IssueDate,
tCorrespondence.RecDelDate, tCorrespondence.Type, tCorrespondence.RefNo,
tCorrespondence.MeanOfDelivery, tCorrespondence.FromToClient,
tCorrespondence.Project, tCorrespondence.Subject, tCorrespondence.FiledAt,
tCorrespondence.PriceVND, tCorrespondence.DocType, tCorrespondence.FollowUp,
tContacts.CompID, tContacts.CompanyFullName, tContacts.BusinessStreet,
tContacts.BusinessCity, tContacts.BusinessCountry, tCorrespondence.ToPerson,
tCorrespondence.DHLNo, tCorrespondence.Comments,
tCorrespondence.PersonSigned, tCorrespondence.CommentsW
FROM tContacts INNER JOIN tCorrespondence ON tContacts.CompID =
tCorrespondence.FromToClient
WHERE (((tCorrespondence.Type)=2));
The above code works all right, but i need to introduce data from
"tContactPersons" and "tProjects" to replace there "IDs" stored in the main
table. How can i do that?
Thank you.
Lana