However, if you're wanting to loop through both the queries and display both
queries data in some type of table format, you'll need to use the order by
clause in your query. Then you can nest your <cfoutput>'s by using the group
clause in your outermost <cfoutput> tag.

Look at the following example:

<cfquery datasource="a2z" name="employees">
        select DepartmentID, Firstname, Lastname
        from employees
        order by DepartmentID, Lastname, Firstname
</cfquery>

your output would go like this:

<cfoutput query="employees" group="DepartmentID">
        <h2>Department #DepartmentID#</h2>

        <cfoutput>
                #Lastname#, #Firstname#
        </cfoutput>
</cfoutput>

I must give credit where credit is due, so thank you Ben Forta. The above
code is an excerpt from the ColdFusion 4.0 Web Application Construction kit
book.

Hope that answers your question.

~Mark

-----Original Message-----
From: Todd Ashworth [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 04, 2000 9:55 AM
To: [EMAIL PROTECTED]
Subject: Re: cfouput


You don't need to.  Every variable inside of a <cfoutput> will be evaluated.

<cfoutput>
#Variables.bob#
#Variables.fred#
#Variables.joe#
#Variables.frank#
</cfoutput>

will all be evaluated.  What I'm assuming you are doing is something like
this:

<cfoutput query="qry1">
    #variable_stuff#
    <cfoutput query="qry2">
        #more_variable_stuff#
    </cfoutput>
</cfoutput>

In this case, do something like this:

<cfoutput>
    #qry1.variable_stuff#
    #qry2.more_variable_stuff#
</cfoutput>

If you need to show all the stuff in the queries, set up <cfloop>s
accordingly.

Todd Ashworth

----- Original Message -----
From: "FARHANAHMAD" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 04, 2000 9:20 AM
Subject: cfouput


| how we can group two output. one is nested under other.
|
| thanks


----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to