<%@ Language=VBScript %> <% Set conn = Server.CreateObject("ADODB.Connection") conn.Open(MM_cotec_STRING) totalPerson = 0 totalSum = 0 'paperTotal = 0 'lunchTotal = 0 sql = "Select * From signData Order By company" Set rs = conn.Execute(sql) counter = 0 '總報名人數 subTotal = 0 '總費用 'paperSum = 0 'lunchSum = 0 %> 第一天 費用統計 <% If Not(rs.Eof And rs.Bof) Then rs.MoveFirst End If Do While Not rs.Eof If IsNull(rs("play")) Then Play = "" Else Play = rs("play") End If If InStr(1,Play,"12/29") Then counter = counter + 1 subTotal = subTotal + rs("sum") 'paperSum = paperSum + rs("paper") 'lunchSum = lunchSum + rs("lunch") totalPerson = totalPerson + 1 totalSum = totalSum + rs("sum") 'paperTotal = paperTotal + rs("paper") 'lunchTotal = lunchTotal + rs("lunch") %> <% End If rs.MoveNext Loop %>
場次 公司名稱 職稱 參加人姓名 電郵 身分 參加場次 費用
12/29 <% If IsNull(rs("company")) Then Response.Write("") Else Response.Write(rs("company")) End If%> <% If IsNull(rs("title")) Then Response.Write("") Else Response.Write(rs("title")) End If%> <% If IsNull(rs("name")) Then Response.Write("") Else Response.Write(rs("name")) End If%> <% If IsNull(rs("title")) Then Response.Write("") Else Response.Write(rs("title")) End If%> <% If IsNull(rs("etype")) Then Response.Write("") Else Response.Write(rs("etype")) End If%> <% If IsNull(rs("play")) Then Response.Write("") Else Response.Write(rs("play")) End If%> <% If IsNull(rs("sum")) Then Response.Write("") Else Response.Write(rs("sum")) End If%>
目前總計:<%=counter%> 人參加報名,總計費用:<%=subTotal%> 元。

目前所有總計:<%=totalPerson%> 人參加報名,總計費用:<%=totalSum%> 元。