Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to count only one of multiple entries

Status
Not open for further replies.

jmj

Programmer
Oct 4, 2001
122
US
I'm wondering if I can do this in a query or need to make a couple of temp tables.
I want a count of many students scored in certain ranges of a test. (0-50/50-69/etc)
I need the following:
1. A student is only counted one time for the test.
2. the highest grade should be counted for each test.

I am using 4 main tables
CourseHistory- shows all the courses each student takes per semester. There are 2 entries for each year long class (and possibly up to 4 entries if a student goes to summer school)
CourseRef- Reference of all the courses
TestRef- a reference table of all the tests given
TestHistory- Shows all the tests a student has taken. A student may have multiple records for one test. (eg: It took 3 tries to pass English).

I am thinking the easiest way would be is to make a new table that shows only the distinct ClassHistory information. Then it should be possible to pull the highest score per test. Am I thinking along the right lines to get the info?
Thanks,
J
 
Can you post some sample data, and the results you are looking for?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top