I don't get what you are trying to do.  The GROUP attribute is to group data
for nested output from one query.

EXAMPLE:

(Your Data)

ID              NAME                            COLOR
-----------------------------------------
1               Quiksilver T-Shirt      Blue
1               Quiksilver T-Shirt      Red
1               Quiksilver T-Shirt      Green
1               Quiksilver T-Shirt      Gray
2               Volcom T-Shirt          Blue
2               Volcom T-Shirt          Black
2               Volcom T-Shirt          White


(Your Code)

<cfquery name="selProd" datasource="#Application.DSN#">
        SELECT ID, NAME, COLOR
        FROM PRODUCT
        ORDER BY NAME
</cfquery>

<pre>
<cfoutput query="selProd" group="NAME">
Product Name:           
#NAME#
Available Colors:
<cfoutput>
#COLOR#
</cfoutput>
</cfoutput>
</pre>


(Your Result)

Product Name:
Quiksilver T-Shirt

Available Colors:
Blue
Red
Green
Gray

Product Name:
Volcom T-Shirt

Available Colors:
Blue
Black
White

I use this function often when I have a record which has many records in a
joined table, so that I can just use one query to grab all of the necessary
data for the output.

Hope this helps!


--
SCOTT VAN VLIET 
SENIOR ANALYST 
SBC SERVICES, INC 
Tel: 858.886.3878 
Fax: 858.653.6763 
Email: [EMAIL PROTECTED]


-----Original Message-----
From: LANCASTER, STEVEN M. (JSC-OL) (BAR)
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 9:24 AM
To: CF-Talk
Subject: Returning only one record HELP PLEASE!!!!


I have 2 queries and I need to know what to do to fix code that looks like
this.
As you will see I am only getting one record from my second query. In the
cfouput tags I have to specify a query and a group because I have nested
tags there is a reason for this. I just need to know how to make it work
this way.. any suggestions?

<cfquery Name="query1" Datasource="DSN">
Select column1, column2
>From Table1
Where this = that
</cfquery>

<cfquery Name="query2" Datasource="DSN">
Select column12, column22
>From Table1
</cfquery>

<CFOUTPUT Query="query1" Group="column1">

<CFMAIL TO="[EMAIL PROTECTED]" FROM="[EMAIL PROTECTED]" SUBJECT="test">
#query1.column1# &nbps; #query2.column22# <!--- is onlt pulling one record
--->
</CFMAIL>
</CFOUTPUT>

Steven Lancaster
Barrios Technology
NASA/JSC
281-244-2444 (voice)
[EMAIL PROTECTED] 


______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to