Sorry,
you need to make sure that the qry_categories specifies a DISTINCT
category.
Try
this...
<cfquery datasource="dsn"
name="qry_categories">
SELECT Category
FROM
Table
WHERE
...
</cfquery>
<cfset listCategories =
QuotedValueList(qry_categories.Category)>
<cfloop list="listCategories" index="i">
<cfoutput>
#i#<br>
</cfoutput>
<cfquery
datasource="dsn" name="qry_people">
SELECT
Person
FROM
Table
WHERE
Category = #i#
</cfquery>
<cfoutput
query="qry_people">
#qry_people.Person#
</cfoutput>
</cfloop>
Is this even possible? I need to display data
from a query thusly:
Category1
Person1
Person2
Person3
Category2
Person1
Person2
Person3
I used the group attribute of the output tag
but that only spit out 1 record.
Without the group attribute I get
Category1
Person1
Category1
Person2
...
Which is what I expect, just not what I
need.
A.
|