这代码那里有错!怎么显示不出来.....

来源:百度知道 编辑:UC知道 时间:2024/06/09 23:43:06
dim un
un=date()
set rs3=server.createobject("adodb.recordset")
sql3="select * from pic where pictime='"&un&"'"
rs3.open sql3,conn,1,3
countpic = rs3.RecordCount
Response.Write "今天更新"&countpic&"条"

我是新手

看一下 pictime 是用的 2007-8-21
还是用是长日期形
如果用的是长日期型
sql3="select * from pic where formatdatetime(pictime,2)='"&un&"'"
去格式化为短日期型
主要看格式对不对了
还有一种方法就是用
sql3="select * from pic where DateDiff('d',pictime,un) = 0"
也是一种算出当天的记录

pictime 这个是不是和里面不一样哦!