Monday, May 24, 2010

How do you pull data from multiple time periods in sql and asp?

For example, I have database with students grades. There are reports for warnings, probation, probation cleared, and dismissal. A student is dismissed if he or she is on probation for 2 whole semesters. How do i select students who are below a 3.0 for 2 or more semesters from the initial probation term. Here is the code so far:





if len(trim(request("reports")))%26gt;0 then


reports= trim(request("reports"))


if reports="Warning List" then


semisql=semisql %26amp; " and T_term_gpa.term_gpa %26lt; 3.0 and T_term_gpa.term_gpa_hour %26lt; 12"


end if


if reports="Probation" then


semisql=semisql %26amp; " and T_term_gpa.term_gpa %26lt; 3.0 and T_term_gpa.term_gpa_hour %26gt; 12"


end if


if reports="Probation Cleared" then


semisql=semisql %26amp; " and T_term_gpa.term_gpa %26gt; 3.0"


end if


if reports="Dismiss" then


??????


end if


end if

How do you pull data from multiple time periods in sql and asp?
I'm not sure what you have for tables, but maybe you can add a table or add to a table the following:





StudentID Spring Fall Summer





12345 _____ W ___P ____C


11223______P ___ P ____P


25256 _____ P___ C ___ P





The idea is when a warning is issued or a probation is added or cleared, it is stored in a look up table. Querying this table for consecutive semesters with 'P' would be simple








hope that helps


No comments:

Post a Comment