ASP & DB Calculations - (Student Gradebook)

# Thread: ASP & DB Calculations - (Student Gradebook)

1. todw17 Guest

## ASP & DB Calculations - (Student Gradebook)

Hi - I want to write a simple program to do some sorting.<BR><BR>Suppose I have a the following table :<BR><BR>id &#124 Name &#124 Math &#124 Science &#124 English<BR>------------------------------------------------------------<BR>1 &#124 Mike &#124 93 &#124 91 &#124 94<BR>2 &#124 Sue &#124 89 &#124 94 &#124 98<BR>3 &#124 Jon &#124 75 &#124 85 &#124 82<BR><BR>I would like to be able to select the grades for a particular student and sort them by from Highest to Lowest. That way I could see what area the student is doing poorly in. I know I could set this up with multiple tables (one for each student), but is there any other way to do it?<BR>

2. Senior Member
Join Date
Dec 1969
Posts
96,118

## RE: ASP & DB Calculations - (Student Gradebook)

Best to do this in ASP/VBS.<BR><BR>Sorting the numbers is, in itself, trivial. The problem is that what you *really* want is to sort the numbers yet still maintain their "links" to the column headings, so you can print out something like this:<BR><BR>Mike English-94 Math-94 Science-91<BR>Sue English-98 Science-94 Math-89<BR><BR>etc.<BR><BR>Right?<BR><BR>And there is really no point of doing more than one student at a time, as there&#039;s no relationship between one students data and another&#039;s, right?<BR><BR>So I&#039;d just write a dead simple routine that sorts on the fly.<BR><BR>1. Write out the student name.<BR>2. Find the highest score remaining; if there are no more positive scores, quit.<BR>3. Write out the field name (class name?) of that score and the score<BR>4. Change that score to a -1<BR>5. Go to step 2<BR><BR>See that? You are using the negative score as a flag meaning "I&#039;ve done this one." Since surely you don&#039;t have more than a dozen or so scores per student, the time to do the loop a dozen times is truly insignificant.<BR><BR>Hokay?<BR><BR><BR>5.

3. Senior Member
Join Date
Dec 1969
Posts
262

## RE: ASP & DB Calculations - (Student Gradebook)

4. Senior Member
Join Date
Dec 1969
Posts
96,118

## Yes, yes...nod, nod...

Clearly superior way. But I&#039;d guess that the semester is almost up and he&#039;s desparate right now!<BR><BR>*THE* way to do it in the long run, though!<BR><BR>

5. todw17 Guest

## RE: Yes, yes...nod, nod...

Actually, I&#039;m not a student. I have been making webpages for a year or so now, and I decided it was time i learned ASP. I figure I can cut down a lot of repetitive files. After getting the basics down (In about a week), I&#039;ve started playing around with it a little to see what I can do with it.<BR><BR>Thanks for all your help.<BR>

6. Senior Member
Join Date
Dec 1969
Posts
96,118

## Heh! *I* thought you were the teacher!

Not the student. I believed what you said about doing this to find what various students needed in the way of help.<BR><BR>Well, indeed you probably want to find a good book on database design. Start with "Normalization" and go from there.<BR><BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•