日期:2014-05-17 浏览次数:20793 次
dim Today Today=date() set rs=Server.CreateObject("ADODB.RecordSet") sql="select * form Item" rs.Open sql,conn,1,3 if rs.RecordCount=0 then response.write "当前无数据!" else for i = 0 to rs.RecordCount-1 if rs.EOF Then Exit For date1=dateiff("d",Today,rs("ATime"))//判断与当前日期的差的天数 date2=dateiff("d",Today,rs("BTime")) date3=dateiff("d",Today,rs("CTime")) date4=dateiff("d",Today,rs("DTime")) if date1>5 then set rs1=Server.CreateObject("ADODB.RecordSet") Renew="UPDATE Item SET TimeLimit = '1'" //如果差的天数符合条件,就更新当前记录里面的TimeLimit rs1.Open Renew,Renew,1,3 set rs1 = nothing end if rs.MoveNext next End if