Hello,
I have got things working, but wonder if there is a better way to do things.
I have an access DB, with many lookup tables, all referrenced in a table of Contacts.
For example
ContactID
FirstName
LastName
SalutationID (lookup from tblSalutations)
IndustryID (lookup from tblIndustry)
ReferralTypeID (lookup from tblReferralType)
etc..
Now, in access the tables store the SalutationID value, but show the Salutation itself (i.e. Mr., Mrs.).
When I build a web based query, the Salutation value not the Salutation itself. So I have taken to creating monstrosities of OUTER JOINs to get all things showing as needed. (use outer joins as not all contacts have salutations, industry type etc.)
I.E.
SELECT c.ContactID, s.Salutation, c.SalutationID, c.FirstName, c.LastName, c.BusinessTitle, c.Organization, c.Street, c.City, c.Province, c.PostalCode, c.Country, t.Industry, c.IndustryID
FROM (tblContacts c LEFT OUTER JOIN
tblSalutation s
ON c.SalutationID = s.SalutationID) LEFT OUTER JOIN
tblIndustry t ON c.IndustryID = t.IndustryID
and so on and so on.
Is there a better / easier way to do this ???
Thanks very much,
Matts
I have got things working, but wonder if there is a better way to do things.
I have an access DB, with many lookup tables, all referrenced in a table of Contacts.
For example
ContactID
FirstName
LastName
SalutationID (lookup from tblSalutations)
IndustryID (lookup from tblIndustry)
ReferralTypeID (lookup from tblReferralType)
etc..
Now, in access the tables store the SalutationID value, but show the Salutation itself (i.e. Mr., Mrs.).
When I build a web based query, the Salutation value not the Salutation itself. So I have taken to creating monstrosities of OUTER JOINs to get all things showing as needed. (use outer joins as not all contacts have salutations, industry type etc.)
I.E.
SELECT c.ContactID, s.Salutation, c.SalutationID, c.FirstName, c.LastName, c.BusinessTitle, c.Organization, c.Street, c.City, c.Province, c.PostalCode, c.Country, t.Industry, c.IndustryID
FROM (tblContacts c LEFT OUTER JOIN
tblSalutation s
ON c.SalutationID = s.SalutationID) LEFT OUTER JOIN
tblIndustry t ON c.IndustryID = t.IndustryID
and so on and so on.
Is there a better / easier way to do this ???
Thanks very much,
Matts