Here is an example. Assumes a table like this:

CREATE TABLE Table1 (
    [book] varchar(20) NOT NULL,
    [chapter] varchar (20) NOT NULL,
    [page] varchar (20) NOT NULL
)



<CFSETTING enablecfoutputonly="true">

<CFSET x = true>

<cfquery datasource="x" username="x" password="x" name="q">

    SELECT
        book, chapter, page
    FROM
        Table1

</cfquery>

<cfoutput group="book" query="q">
<table>
  <tr>
    <td width="100">#book#<cfoutput group="chapter"></td>

    <CFSET color="#IIF( x, DE(""), DE(" bgcolor=####00948c"))#">
    <td#color#>#chapter#</td>
    <td#color#><cfoutput>#page# </cfoutput></td>

    <cfset x = not x>
  </tr>
  <tr>
    <td>&nbsp;
    </cfoutput>
    </td>
  </tr>
</table>
</cfoutput>



David L. Penton
"Mathematics is music for the mind, and Music is Mathematics for the
Soul." - J.S. Bach
[EMAIL PROTECTED]

  "If you want an ISP with great Network
   connectivity and great email,
   DON'T use AT&T @Home"


-----Original Message-----
From: Palyne Gaenir

Anybody know where I can find a code example of how to do multiple
levels ('nested' grouping) properly on a query output?  Like group
records for each chapter; within that, group records for each
section; within that, group records for each page.  Thanks. -- Palyne


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to