2 Replies Latest reply on Oct 4, 2008 5:43 PM by Chris Luksha

    HOw Do I count and identify the number of groups in a groups output.

    Chris Luksha Level 1
      I have a query that reads like this..

      SELECT s.spec_Sort,s.spec_ID, s.spec_Name, b.bus_Name, b.bus_ID
      FROM (tbl_businesses as b INNER JOIN tbl_SpecBusRel as sb ON b.bus_ID = sb.specbus_busid) INNER JOIN tbl_specialties as s ON sb.specbus_specid = s.spec_ID
      ORDER BY s.spec_Sort, b.bus_Name

      and then I am outputing like this...
      <cfoutput query="rsGetSpecialties" group="spec_Name">
      <cfif THIS IS WHAT I NEED)></td><td></cfif>
      <h2><a class="specialty" href="javascript;" onclick="dwfaq_ToggleOMaticDisplay(this,'#spec_ID#');return document.MM_returnValue">#spec_Name#</a></h2>
      <div id="#spec_ID#" style="display:none">
      <cfoutput><p><a href="#request.details#?bus_ID=#bus_ID#">#bus_Name#</a></p></cfoutput>

      This displays in this manner...

      What I am trying to do is find out how many specialties there are, figure out where the middle is so I can insert a new table data cell and start a new column.

      Basically - two columns with the data divided in half by specialty NOT by the number of dealers.

      I hope that makes sense. Of course I am trying to do it w/ as little query action as possible. My only solution may be to have more than one query and the second only finds a list of the sepcialties that contain the dealers and then find the middle one and simply say if current specialty = middleSpecialty then start a new column.

      Thanks all,