OK, is query2 only *supposed* to be outputting one record? I don't think you need to group the first query:
<CFMAIL TO="[EMAIL PROTECTED]" FROM="[EMAIL PROTECTED]" SUBJECT="test" QUERY="query1"> #column1# &nbps; #query2.column2# </CFMAIL> Sharon DiOrio ----- Original Message ----- From: "LANCASTER, STEVEN M. (JSC-OL) (BAR)" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, March 26, 2002 1:02 PM Subject: RE: Returning only one record HELP PLEASE!!!! > I am not allowed to post data. but what I put out is very close to what I > have.. > > I have multiple records in both tables and query2 is only outputting one > record. > > <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] > > > > -----Original Message----- > From: VAN VLIET, SCOTT E (SBCSI) [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 11:54 AM > To: CF-Talk > Subject: RE: Returning only one record HELP PLEASE!!!! > > > What are you trying to accomplish? > > The GROUP attribute will only work with the QUERY specified in the top-level > CFOUTPUT tag. If you have grouped data, the you could join in the second > table instead of querying it separately. > > Please post some sample data so that I can try to help you a little more. > > -- > SCOTT VAN VLIET > SENIOR ANALYST > SBC SERVICES, INC > Tel: 858.886.3878 > Fax: 858.653.6763 > Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > > > -----Original Message----- > From: LANCASTER, STEVEN M. (JSC-OL) (BAR) > [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 9:49 AM > To: CF-Talk > Subject: RE: Returning only one record HELP PLEASE!!!! > > > with that also work with 2 queries? > > Steven Lancaster > Barrios Technology > NASA/JSC > 281-244-2444 (voice) > [EMAIL PROTECTED] > > > > -----Original Message----- > From: VAN VLIET, SCOTT E (SBCSI) [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 11:40 AM > To: CF-Talk > Subject: RE: Returning only one record HELP PLEASE!!!! > > > 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