Skip to main content
October 4, 2008
Question

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

  • October 4, 2008
  • 2 replies
  • 367 views
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>
</div>
</cfoutput>

This displays in this manner...
Specialty
dealer
Specialty
dealer1
dealer2
Etc...

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,
Chris
This topic has been closed for replies.

2 replies

October 5, 2008
I didn't know I had double posted - the first 'submit' gave me an error - so I did not know it went through. So I hit the back button and resubmitted

sorry
BKBK
Community Expert
Community Expert
October 4, 2008
No need to double-post.