|
<%
Dim GetMonthMaxDay
GetMonthMaxDay=Day(DateAdd("d", -1, DateAdd("m", 1, CDate(year(date) &"-"& month(date()) &"-1"))))
for i = 1 to GetMonthMaxDay
SelNewDay = Cdate(year(date()) &"-"& month(date()) &"-"& i)
MonthCount = 0
SQL = "select [要统计的字段price] from [table] where date = '"& SelNewDay &"'"
rs.open Sql,conn,1,1
do while not rs.eof
MonthCount = MonthCount + rs("price")
rs.movenext
loop
response.Write(SelNewDay&"合计:"& MonthCount &" 元<BR><BR>")
next
%> |
|