function GetTotalFee(rsObj)set rs = rsobjallsum = 0rs.Movefirstwhile not rs.eof daysum =0 for i=6 to rs.fields.count-8 if instr(lcase(rs.fields(i).name),"remark")=0 then if Not IsNull(rs(rs.fields(i).name)) then if cint(trim(rs(rs.fields(i).name)))<>0 then daysum=daysum+cint(trim(rs(rs.fields(i).name))) 'Response.write daysum&"<br>" end if end if end if next allsum = allsum + cint(daysum) rs.MoveNextwendGetTotalFee = allsumend function sql_display="select * from expense where fileno ='"&strBH&"' order by expenseDate asc" set objDisplay=conn.execute(sql_display) 调用 <%=GetTotalFee(objDisplay) %> 相关文章: