Thanks Dan! I worked my problem around. The problem is that I
was dumping my structure. I forgot that the dump function
automatically sorts the structure in a way that makes sense to the
human eye to see on the screen. So I thought that I could
manipulate my elements just the way I was looking at them. I was
wrong. I sorted my structure and sub-structures using:
ListSort(StructKeyList(StudentListStruct)
This way I got a sorted list of elements. I was getting an
exception because obviously I was referencing the wrong position of
my data because my data was not organized as I thought it was. Once
I sorted my data my problems disappeared. I just looped through my
lists and verified the existence of the element then printed on
screen otherwise prints zero.
My problem was not writing a query that group my counts in
the form of GRADE LEVEL - ETHNICITY - GENDER, the problem was to
layout those elements in an HTML table for printing. I thought it
was more intelligent to use the power of structures here. So to
print my elements I wrote:
<cfif StructKeyExists(StudentListStruct, x) AND
StructKeyExists(StudentListStruct
, y) AND
StructKeyExists(StudentListStruct, z)>
#StudentListStruct.TOTALSTUDENTS#
<cfelse>
0
</cfif>
Where X represent an array of grade levels, Y represents an
array of ethnicities and Z represents a list with two elements F
and M for female and male.
Thanks to those who replied and helped! I really appreciate
it!
Apocalipsis!