Oh man that rocks. It's only got a couple of flaws. Which I'm sure I caused.
I've probably way over edited the code trying to figure out what I did wrong, and how to fix it.
I really appreciate your help here.
Think you could have a look at this and give it one more go?
http://students.eastcentraltech.edu/dcarroll/monday_report.cfm
There are a few things repeating. The sites and sessions for the most part. But then down further something else caught my eye. I want it to show the returning and new students on the same line, in two other columns, as the class.
It currently shows all of the classes with new students then runs back through and shows the same class with returning students.
To show you what I mean here is the Text output. No fancy attempts to format.
http://students.eastcentraltech.edu/dcarroll/mondaytext.cfm
Thanks again for all of this help you are giving me.
The code as it stands ::
<!--- get the unique data to display,
, subselect the count of duplicate rows
which will be used to determine enrollment
(I think) --->
<cfquery name="get_sites" datasource="books">
SELECT DISTINCT a.site
, a.sess
, a.type
, a.majr
, ( SELECT count(id) AS number_students
FROM enr_report b
GROUP BY b.site
, b.sess
, b.type
, b.majr
HAVING b.site = a.site
AND b.sess = a.sess
AND b.type = a.type
AND b.majr = a.majr
) AS number_students
FROM enr_report a
ORDER BY a.site
, a.sess
, a.type
, a.majr
</cfquery>
<!--- /get the unique data to display,
, subselect the count of duplicate rows
which will be used to determine enrollment
(I think) --->
<!--- the structure applied to your table formatting --->
<!--- using font tags is no way to go through life, tags removed, style added --->
<style>
.a3 {
font-family:Arial;
font-size:12pt;
text-align:left;
background-color:#003194;
}
.red {
color:red;
}
.yellow {
color:yellow;
}
.green {
color:green;
}
.white {
color:white;
}
.bold {
font-weight:bold;
}
</style>
<!--- /using font tags is no way to go through life, tags removed, style added --->
<table border="0" width="81%" bgcolor="##000000" cellspacing="1" cellpadding="0" col="4">
<cfoutput query="get_sites" group="site">
<tr>
<td class="a3 bold red">  <cfoutput>#get_sites.site#</cfoutput></td>
<td class="a3 bold white">  New</td>
<td class="a3 bold white">  Returning</td>
</tr>
<!--- loop through the subset of data while the site is the same --->
<cfoutput group="sess">
<tr>
<td class="a3 bold yellow">       <cfoutput>#get_sites.sess#</cfoutput></td>
<td class="a3"> </td>
<td class="a3"> </td>
</tr>
<!--- while session stays the same the following code repeats --->
<cfoutput>
<tr>
<td class="a3 bold green">            #majr#</td>
<td class="a3 bold white">  #type#</td>
<td class="a3 bold white">  #number_students#</td>
</tr>
</cfoutput>
<!--- /while session stays the same the following code repeats --->
</cfoutput>
<!--- /loop through the subset of data while the site is the same --->
</cfoutput>
</table>
<!--- /the structure applied to your table formatting --->
</table>