Skip to main content
February 4, 2009
Question

How to fix this code?

  • February 4, 2009
  • 3 replies
  • 473 views
Hello,

I am trying to display country, state within each country, then person in each state...using cfoutput and group.

i am getting this error...How can i fix this code?

The &lt;cfif&gt; tag requires an end tag to nest within &lt;cfoutput&gt;, which began on line 21, column 26.<p>The CFML compiler was processing:<ul><li>The body of a cfoutput tag beginning on line 26, column 34.<li>The body of a cfoutput tag beginning on line 26, column 34.</ul>
    This topic has been closed for replies.

    3 replies

    Inspiring
    February 4, 2009
    like this
    <cfoutput query = something group = field1>
    #field1#
    <cfoutput group = field2>
    #field2#
    <cfoutput>
    #ungrouped data#
    closing tags.

    Make sure your query has an order by clause that coincides with the order in which you are going to group your output.
    February 4, 2009
    Thanks Bob,

    You are correct..

    But what is solution for displaying like this......

    Inspiring
    February 4, 2009
    Rather then including <cfif county_q.state neq ''> in your CF code eliminate any records with an empty state in your query. The sample appears to have a country, state, and name value for every record.

    If this is not possible please post a more code including:
    1. Your query
    2. A sample of your data with and without an empty state value
    Inspiring
    February 4, 2009
    I don't think you can conditionally end a cfoutput block like this:
    <cfif county_q.state neq ''>
    </cfoutput>
    </cfif>