<%
for i=1 to 12
Set rs=server.createobject("adodb.recordset")
rs.open "select distinct(writter) from ZD_Article",conn,1,1
if not(rs.eof and rs.bof) then
do while not rs.eof
response.write conn.execute("select count(*) from ZD_Article where writter='"&rs("writter")&"' and addtime like '%2008-"&i&"%'")(0)
rs.movenext
loop
end if
rs.close
set rs=nothing
next
%>
总共:
<% set rs=server.CreateObject("adodb.recordset")
sql="select * from news where writer='小强'" rs.open sql,connstr,1,1 response.Write rs.recordcount rs.close %>
本月:
<% set rs=server.CreateObject("adodb.recordset")
sql="select * from news where writer='小强' and datediff('m',addtime,now)=0 " rs.open sql,connstr,1,1 response.Write rs.recordcount rs.close %>