Skip to main content
Inspiring
November 20, 2009
Question

Query output to multiple columns (list?)

  • November 20, 2009
  • 1 reply
  • 909 views

I have a query that extracts data about companies, people and offices.  After I display the company info, I want to display the people/office data in 2 columns, with a list of people on the left and offices on the right.  There is no correlation between the 2 columns, i.e. I will have a list of all of the company's people on the left, and all of the company's offices on the right.

I can do this with cfoutput into a table with 2 TD areas, and this works fine for a company with 1 employee and 1 office, a matching number of employees and offices, and 1 of either with multiples of the other.  If I do this output with non-matching multiples of both, I end up with wierd looking lists with data that does not show up side by side.

I was told that the best way for me to do this is with Lists, but I cannot seem to find any clear instructions, or good examples, on how to do this.

Anyone? 

This topic has been closed for replies.

1 reply

Inspiring
November 20, 2009

What does the initial record set look like?

Inspiring
November 20, 2009

Company.Name, Company.City, etc, Employee.LastName, Employee.FirstName, Employee.MiddleName, etc., Office.Address, Office.City, Office.Zip, etc.  All of this data is extracted in the same query.

Inspiring
November 20, 2009

Would a subset of a dump look anything like this?

companyname     employeename     officecity

abc                     Jim                      Toronto

abc                     John                     Montreal

abc                     Jane                     Toronto

Also, can we assume that employees work in only one office and each office has at least one employee?  In other words, the number of offices will never exceed the number of people?