<% sql_where = " where c_Idx = '"& c_idx &"'" sql_orderby = " order by testNo asc, subjectNo asc, partNo asc, chapterNo asc" sql = "select * from 과목테이블명 " sql = sql & sql_where Set rs = objConn.execute(sql) ' oriTestNo = "1" ' oriSubjectNo = "1" ' oriPartNo = "1" testQcount = 0 subjectQcount = 0 partQcount = 0 totalQcount = 0 If Not(rs.eof Or rs.bof) Then i = 1 Do Until rs.eof idx = rs("idx") testNo = rs("testNo") subjectNo = rs("subjectNo") partNo = rs("partNo") qCount = rs("qCount") 'PART 합계 If i > 1 And oriPartNo <> partNo Then %> <% partQcount = 0 End If 'SUBJECT 합계 If i > 1 And oriSubjectNo <> subjectNo Then %> <% subjectQcount = 0 End If 'TEST 합계 If i > 1 And oriTestNo <> testNo Then %> <% testQcount = 0 End If oriTestNo = testNo oriSubjectNo = subjectNo oriPartNo = partNo %> <% testQcount = testQcount + qCount 'test합계 subjectQcount = subjectQcount + qCount 'subject합계 partQcount = partQcount + qCount 'part합계 totalQcount = totalQcount + qCount '총 합계 i = i + 1 rs.movenext Loop '맨 아래 row는 위 계산법으로 안됨.를 위함(S) 'PART 합계 If i > 1 And oriPartNo = partNo Then %> <% End If 'SUBJECT 합계 If i > 1 And oriSubjectNo = subjectNo Then %> <% End If 'TEST 합계 If i > 1 And oriTestNo = testNo Then %> <% End If '맨 아래를 위함(E) %> <% Else %> <% End If rs.close Set rs = Nothing %>
번호 tNo test명 sNo subject명 pNo part명 cNo chapter명 사용여부 출제수 비고
PART 합계 <%=partQcount%>  
SUBJECT 합계 <%=subjectQcount%>  
TEST 합계 <%=testQcount%>  
<%=rs("idx")%> " name="testNo" value="<%=rs("testNo")%>" size="1" style="text-align:right;"> " name="testName" value="<%=rs("testName")%>" size="15" maxlength="40"> " name="subjectNo" value="<%=rs("subjectNo")%>" size="1" style="text-align:right;"> " name="subjectName" value="<%=rs("subjectName")%>" size="15" maxlength="40"> " name="partNo" value="<%=rs("partNo")%>" size="1" style="text-align:right;"> " name="partName" value="<%=rs("partName")%>" size="15" maxlength="40"> " name="chapterNo" value="<%=rs("chapterNo")%>" size="1" style="text-align:right;"> " name="chapterName" value="<%=rs("chapterName")%>" size="15" maxlength="40"> " size="1" value="<%=rs("qCount")%>" style="text-align:right;">
PART 합계 <%=partQcount%>  
SUBJECT 합계 <%=subjectQcount%>  
TEST 합계 <%=testQcount%>  
총 합계 <%=totalQcount%>  
등록된 정보가 없습니다.