Adobe Dreamweaver Forums



Last 10 THreads :         FLV won't work (Last Post : mixmasterdsr04 - Replies : 0 - Views : 1 )           »          WebHelp Compile Won't Display (Last Post : Peter Grainge - Replies : 19 - Views : 20 )           »          Context-Sensitive Neophyte Questions (Last Post : Peter Grainge - Replies : 1 - Views : 2 )           »          Filtering XMLList by partial string (Last Post : invisibleBlade - Replies : 4 - Views : 5 )           »          Scripting for Interactive buttons (Last Post : Andrew Morton - Replies : 3 - Views : 4 )           »          Brush Script STD Font Not Showing In Safari (Last Post : Dooza - Replies : 5 - Views : 6 )           »          Favicon for context-sensitive Help (WebHelp) (Last Post : Peter Grainge - Replies : 1 - Views : 2 )           »          Flash 10 hangs Internet Explorer 7 on Vista? (Last Post : Gary Goldblum - Replies : 69 - Views : 583 )           »          Anyone know why I can't refer to a label control(id="address") in the component I created? (Last Post : jcahill23 - Replies : 0 - Views : 1 )           »          Anyone know why I can't refer to a label control(id="address") in the component I created? (Last Post : jcahill23 - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Cold Fusion
 
Tags:



Reply
  #1 (permalink)  
Old 10-01-2008, 04:00 AM
chrispilie
 
Posts: n/a
Diggs:
Default Nested Query Loop

I have a query that I want to loop over the data and display. The query is an
inner join with one table being order numbers and the second being details on
each order. They are joined by the order number. What i am trying to do is loop
over the data and group all the details under the order number. I have tried
numerous nesting configurations and I have had no luck. This is what I would
like to see.

Order Number 1
Item 1
Item 2
Item 3

Order Number 2
Item 1
Item 2

Order Number 3
item 1
Item 2
Item 3
Item 4

Any recomendations?






Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-01-2008, 04:00 AM
Azadi
 
Posts: n/a
Diggs:
Default Re: Nested Query Loop

<cfoutput> tag has a GROUP attribute - check it out.
the doc are available online if you do not have them.

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Reply With Quote
  #3 (permalink)  
Old 10-01-2008, 04:00 AM
Azadi
 
Posts: n/a
Diggs:
Default Re: Nested Query Loop

<cfoutput> tag has a GROUP attribute - check it out.
the doc are available online if you do not have them.

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Reply With Quote


  #4 (permalink)  
Old 10-01-2008, 04:00 AM
-==cfSearching==-
 
Posts: n/a
Diggs:
Default Re: Nested Query Loop

You could use the "group" attribute of cfoutput. In your sql query, sort the
results by the [OrderNumber] column. Then group by [OrderNumber] in your
output.

<cfoutput query="yourQuery" group="OrderNumber">
<!---- each order number will be displayed only once --->
#OrderNumber#<br>

<cfoutput>
#ItemNumber#
<cfoutput>
</cfoutput>


http://livedocs.adobe.com/coldfusion...Tags_m-o_16.ht
ml


Reply With Quote
  #5 (permalink)  
Old 10-01-2008, 04:00 AM
-==cfSearching==-
 
Posts: n/a
Diggs:
Default Re: Nested Query Loop

You could use the "group" attribute of cfoutput. In your sql query, sort the
results by the [OrderNumber] column. Then group by [OrderNumber] in your
output.

<cfoutput query="yourQuery" group="OrderNumber">
<!---- each order number will be displayed only once --->
#OrderNumber#<br>

<cfoutput>
#ItemNumber#
<cfoutput>
</cfoutput>


http://livedocs.adobe.com/coldfusion...Tags_m-o_16.ht
ml


Reply With Quote
  #6 (permalink)  
Old 10-01-2008, 04:00 AM
chrispilie
 
Posts: n/a
Diggs:
Default Re: Nested Query Loop

Thanks guys! I had been trying that approach but apparently I was doing
something wrong before. I had been getting nesting cfoutput errors and then I
was lost in a formatting mess. Thanks again for the direction.

Reply With Quote


  #7 (permalink)  
Old 10-01-2008, 04:00 AM
chrispilie
 
Posts: n/a
Diggs:
Default Re: Nested Query Loop

Thanks guys! I had been trying that approach but apparently I was doing
something wrong before. I had been getting nesting cfoutput errors and then I
was lost in a formatting mess. Thanks again for the direction.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk