[AccessD] Help with code

Drew Wutka DWUTKA at Marlow.com
Tue Sep 25 14:12:30 CDT 2007


No code necessary.  Here's an example of how to do this with a query, on
tblGrades.  There are three fields.  Student, GradeLevel and GPA:

SELECT T1.Student, T1.GradeLevel, T1.GPA, (SELECT Count(*) FROM
tblGrades WHERE GradeLevel=T1.GradeLevel) AS [Kids in Grade], (SELECT
Count(*) FROM tblGrades WHERE GradeLevel=T1.GradeLevel and GPA>=T1.GPA)
AS [Rank in Grade]
FROM tblGrades AS T1;

The last two columns will return the number of students in that grade,
and the rank of that student within that grade.

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Klos, Susan
Sent: Tuesday, September 25, 2007 1:37 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Help with code

I am trying to Rank Student scores within a grade within a school.  I
got the majority of code from the internet and it worked fine except
that I need to loop through the records by grade and I won't know how
many records are in each grade.  I made a loop to count the records in
the grade but then how do I get back to the first record in that grade
in order to rank it.  I may have my loop in the wrong place I don't
know.  There are only 2 records in grade 4.  The third record starts
grade 5 and there are 145 in grade 5 and 161 in grade 6.  I can send a
spreadsheet for anyone who would like some data to play with.  Thanks in
advance for the help.  

 

Susan Klos

Evaluation and Reporting

325 W. Gaines Street

Tallahassee, FL  32399

850-245-0708

susan.klos at fldoe.org
 

Please take a few minutes to provide feedback on the quality of service
you received from our staff. The Department of Education values your
feedback as a customer. Commissioner of Education Jeanine Blomberg is
committed to continuously assessing and improving the level and quality
of services provided to you.Simply use the link below.  Thank you in
advance for completing the survey.
 

http://data.fldoe.org/cs/default.cfm?staff=Susan.Klos@fldoe.org|14:37:18
%20Tue%2025%20Sep%202007
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list