• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Guest
Oct 03, 2008 Oct 03, 2008

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

318

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2008 Oct 04, 2008

Copy link to clipboard

Copied

No need to double-post.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 04, 2008 Oct 04, 2008

Copy link to clipboard

Copied

LATEST
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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation