28,406
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<title>统计详细 </title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--建立rs记录集-->
<%
Dim sdate,eate,conn,rs,totalnum,sql
sdate=request.form("sj1"): if sdate="" then sdate=date()
edate=request.form("sj2"): if edate="" then edate=date()
Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")
conn.open MM_conn_STRING
if conn.state<>1 then response.write "连库错误": response.end
totalnum = 0
sql="SELECT 录入人员,count(录入人员) as 出现次数 FROM dbo.khb " _
&" WHERE 录入日期 BETWEEN '"&sj1&"' AND '"&sj2&"'" _
& "group by 录入人员 ORDER BY count(录入人员) DESC "
rs.open sql,conn,1,1
%>
<!--建立kh1记录集结束-->
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr background="images/bj.gif" bgcolor="#FFFFFF" height="27">
<td colspan="4"><%=sdate%>到<%=edate%>客户量统计</td>
</tr>
<tr height="20" align="center" bgcolor="#FFFFFF">
<td width="15%"><strong>姓名</strong></td>
<td width="65%"><strong>客户统计</strong></td>
<td width="10%"><strong>百分比</strong></td>
<td width="10%"><strong>客户数</strong></td>
</tr>
<%do while not rs.eof%>
<tr bgcolor="#FFFFFF">
<%
a=(kh_total)'哪里来的?不知道
b=rs("出现次数 ")&""
if a<>0 or a<>"" then c=formatnumber(b*100/a,2)'将出现次数转成百分比
%>
<td height="20" align="center"><%=rs("录入人员")%></td>
<td>
<table width=" <%= c %>%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="14" bgcolor="#0000CC"> </td></tr>
</table>
</td>
<td align="center"><%If c>=1 Then response.write c&"%" else response.write "0"&c&"%"%></td>
<td align="center"><%=rs("出现次数")&""%> </td>
</tr>
<%
rs.MoveNext()
loop
rs.close: set rs=nothing
conn.close: set conn=nothing
%>
</table>
</body>
</html>
