SlimSquirrel
New member
- Local time
- Today, 00:02
- Joined
- Aug 4, 2015
- Messages
- 6
I have a couple of tables in a database and following the rules of normalisation have separated the contacts from the companies. I have managed to display the data in many different ways using standard queries but cannot do a simple “transpose” like you can in excel. My tables are set out as follows:
CompanyTable:
CompanyID
CompanyName
ContactTable:
ContactID
CompanyID (as a foreign key)
ContactName
I now have several companies and several hundred contacts and would like to display the data with the company names as rows followed by the relevant contacts to that company in the next field across. Please see example below:
CompanyName1 ContactName1ContactName2ContactName3ContactName4
CompanyName2 ContactName5ContactName6
CompanyName3 ContactName7ContactName8ContactName9
CompanyName4 ContactName10
The amount of columns needs to be variable as some companies have several contacts and others have very few.
What I am trying to achieve is not too dissimilar to a crosstab query (or a pivot table in excel) but without the numeric totals / values.
Is this something simple that I am missing?
Thanks in advance.
Slim
CompanyTable:
CompanyID
CompanyName
ContactTable:
ContactID
CompanyID (as a foreign key)
ContactName
I now have several companies and several hundred contacts and would like to display the data with the company names as rows followed by the relevant contacts to that company in the next field across. Please see example below:
CompanyName1 ContactName1ContactName2ContactName3ContactName4
CompanyName2 ContactName5ContactName6
CompanyName3 ContactName7ContactName8ContactName9
CompanyName4 ContactName10
The amount of columns needs to be variable as some companies have several contacts and others have very few.
What I am trying to achieve is not too dissimilar to a crosstab query (or a pivot table in excel) but without the numeric totals / values.
Is this something simple that I am missing?
Thanks in advance.
Slim