求助:ASP 字段统计

来源:百度知道 编辑:UC知道 时间:2024/05/28 15:44:20
请教一个ASP字段统计问题
想从表Info的字段writeform中统计出 小月 的数量.也就是说字段writeform中有不同的值,如小月 小亮等.想统计小月的个数.
下面我有一段代码.但提示有错误.想请教明白人解决一下.万分感谢.
<%
function count_biao(biao)
set rskz=server.createobject("adodb.recordset")
set rskz=conn.execute("select count(*) as writeform from "&biao&" where writeform ='小月' group by writeform")
Response.Write rskz(0)
rskz.close
set rskz=nothing
end function
%>
<%= count_biao("Info") %>
错误提示:"至少一个参数没有被指定值。"
想知道怎么改,哪位帮改一下。谢谢
我试了StevenWong_BD方法,错误变为
错误类型:
Microsoft VBScript 编译器错误 (0x800A03EA)
语法错误
/Topdep.asp, line 17, column 15
Response.Write(call count_biao("Info"))
--------------^
盼 StevenWong_BD 能再帮一把

请教哪位再帮一下。或留个联系方法

group by 不能和where 一起使用!
只能和having用!
所以sql语句有错!
这里好像不让留,到百度我的空间把

<%
function count_biao(biao)
set rskz=server.createobject("adodb.recordset")
set rskz=conn.execute("select count(*) from " & biao & " where writeform ='小月' group by writeform")
Response.Write rskz(0)
rskz.close
set rskz=nothing
end function
%>
<%=call count_biao("Info") %>

试试