主题:[原创]有关时间天数问题--望高手指教
我要删除30天没有登录的用户的相关产品的记录,可以我下面的语句执行后是将所有的记录给删除了,不管是一天还是两天前有登录的也被删除.请问是哪儿出错了呢?
do while not rs_gezi.eof
' userid = rs_gezi("userid")
set rs = server.CreateObject("adodb.recordset")
sql = "delete from gezi where userid in (select userid from [user] where datediff(""d"",lastdate,'"&now()&"') > 30)"
rs.open sql,connsql,1,3
rs_gezi.movenext()
loop
do while not rs_gezi.eof
' userid = rs_gezi("userid")
set rs = server.CreateObject("adodb.recordset")
sql = "delete from gezi where userid in (select userid from [user] where datediff(""d"",lastdate,'"&now()&"') > 30)"
rs.open sql,connsql,1,3
rs_gezi.movenext()
loop