That Worked Thank You!! 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 12:39 PM To: CF-Talk Subject: RE: Returning only one record HELP PLEASE!!!! It is not progressing through the second query, only the first. Do you want each mail message to contain all of the data in for Column22 in the second query? If so, then you would need to loop over that query and output each record - separately from the top-level CFOUTPUT (as that pertains only to the first query). <CFOUTPUT Query="query1" Group="column1"> <CFMAIL TO="[EMAIL PROTECTED]" FROM="[EMAIL PROTECTED]" SUBJECT="test"> #query1.column1# &nbps; <cfloop query="query2"> #query2.column22# </cfloop> </CFMAIL> </CFOUTPUT> Note that in this case, you may or may note need the GROUP attribute. Using it in the case would result in output with a sort-of "DISTINCT" group of COLUMN1 values. 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 10:32 AM To: CF-Talk Subject: RE: Returning only one record HELP PLEASE!!!! you can't when you have nested tags. Steven Lancaster Barrios Technology NASA/JSC 281-244-2444 (voice) [EMAIL PROTECTED] -----Original Message----- From: Albrechtas, Adam [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 12:14 PM To: CF-Talk Subject: RE: Returning only one record HELP PLEASE!!!! Get rid of the group parameter of your cfoutput -----Original Message----- From: LANCASTER, STEVEN M. (JSC-OL) (BAR) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 1:02 PM To: CF-Talk 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="#Xpplication.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] ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

