View Single Post
  #3  
Old August 26th, 2004, 04:25 AM
cwr
external usenet poster
 
Posts: n/a
Default

Thank you ...what you gave me worked. Actually, I do have a field named
Year...so far has not caused problems, but think I might change it in case.



"tina" wrote:

try this, substituting correct table and field names, of course:

SELECT School, SchYear, Count(Student) AS CountOfStudent
FROM (SELECT DISTINCT School, SchYear, Student
FROM Table14)
GROUP BY School, SchYear

btw, i hope you don't have a table field actually named "Year". that might
cause problems.

hth


wrote in message
...
I have spent hours trying to select a count.
I have a table with 3 of the ten columns containing a
student id, a year and a school id. I am trying to
create a report that will list each school, year, and
count of student ids.

example: there could be 10 records with school ID = 1,
year = 2003 and studenid = 123....what is different with
each of these records is a course id, dates, etc.
I am trying to set a query up using new query with sql
specific to code select statement .....i would need
distinct on all 3 fields with a count of distinct student
IDs..if am trying nesting in selects.

SELECT count(studentID), schoolID, year
FROM
(select distinct (studentID), schoolID, year from
( select studentID, distinct (schoolID), year from
(select studentID, schoolID, distinct (year) from
tblStudentCourseAndGrades));


Any help appreciated.