|
原来用的,access改称SQL后
下面代码就不显示
怎么办?有什么要注意的地方么?经测试是红色加粗字体部分,有问题,,,这段在Access数据库中可正常显示,,但改成SQL数据库之后就不显示,,,我的SQL时间为默认getdate(),,不知该怎么改?
<% '读出本月的 然后分为每天,在写出
'获得当前月天数
thisdays=DateDiff("d",year(now)&"-"&month(now)&"-"&"1",year(now)&"-"&month(now)+1&"-"&"1")
'建立数组,分别存储 每天的 总收入,单数
dim dayshouru()
redim dayshouru(thisdays,2)
set drs= Server.CreateObject("adodb.recordset")
drs.open ("select * from boodingdan where dxingwei=0 and dzhuangtai in (1,2,3) and dtime like '%"&year(now)&"-"&month(now)&"-"&"%'"),conn,1,1
if not drs.eof then
'根据天数决定数组
for dd=1 to int(drs.recordcount)
'按时间判断并分类
today=replace(left(drs("dtime"),instr(drs("dtime")," ")-1),year(now)&"-"&month(now)&"-","")
dayshouru(today,1)=dayshouru(today,1)+drs("djia")*drs("dshu")+drs("dyunfei")+drs("dzhangzhe")
dayshouru(today,2)=dayshouru(today,2)+1
drs.movenext
next
end if
drs.close
set drs=nothing
zongshouru=0
zongbishu=0
total_no=thisdays
dim total()
redim total(total_no,2)
for xs=1 to total_no
total(xs,1)=dayshouru(xs,1)
total(xs,2)=xs
'总收入和总数量
if dayshouru(xs,1)<>"" then zongshouru=zongshouru+dayshouru(xs,1)
if dayshouru(xs,2)<>"" then zongbishu=zongbishu+dayshouru(xs,2)
next
%>
<td width="15%">目前总成交消费金额:</td>
<td width="22%"><font color="#FF0000" size="3"><b><%= zongshouru %>?元</b></font></td>
<td width="13%">目前总成交笔数:</td>
<td width="17%"><font color="#FF0000"><%= zongbishu %>?笔</font>交易</td> |
|