28,390
社区成员
发帖
与我相关
我的任务
分享
set rsexd=server.CreateObject("adodb.recordset")
sqlexd="select * from corporation "
rsexd.open sqlexd,conn,1,3
if not rsexd.eof then
do while not rsexd.eof
if rsexd("EndDate")<>"" then
if rsexd("EndDate")>date() then
rsexd("exd")=0 '修改表exd字段的值
else
rsexd("exd")=1 '修改表exd字段的值
end if
else
rsexd("exd")=0 '修改表exd字段的值
end if
rsexd.movenext
loop
rsexd.close
end if
set rsexd=server.CreateObject("adodb.recordset")
sqlexd="select * from corporation "
rsexd.open sqlexd,conn,1,3
if not rsexd.eof then
do while not rsexd.eof
if rsexd("EndDate")<>"" then
if rsexd("EndDate")>date() then
rsexd("exd")=0 '修改表exd字段的值
else
rsexd("exd")=1 '修改表exd字段的值
end if
else
rsexd("exd")=0 '修改表exd字段的值
end if
rsexd.update ’这里修改了,还是不可以
rsexd.movenext
loop
rsexd.close
end if
<%
set rsexd=server.CreateObject("adodb.recordset")
sqlexd="select * from corporation "
rsexd.open sqlexd,conn,1,4 '批量递交
if not (rsexd.eof and rsexd.bof) then
do while not rsexd.eof
if rsexd("EndDate").value<>"" And Not IsNull(rsexd("EndDate").value) then
if DateDiff("d",rsexd("EndDate").value,date())<0 then
rsexd("exd")=0 '修改表exd字段的值
else
rsexd("exd")=1 '修改表exd字段的值
end if
else
rsexd("exd")=0 '修改表exd字段的值
end if
rsexd.movenext
loop
rsexd.updateBatch '批量递交
rsexd.close
end if
%>
<%
set rsexd=server.CreateObject("adodb.recordset")
sqlexd="select * from corporation "
rsexd.open sqlexd,conn,1,4 '批量递交
if not (rsexd.eof and rsexd.bof) then
do while not rsexd.eof
if rsexd("EndDate").value<>"" And Not IsNull(rsexd("EndDate").value) then
if DateDiff('d',rsexd("EndDate").value,date())<0 then
rsexd("exd")=0 '修改表exd字段的值
else
rsexd("exd")=1 '修改表exd字段的值
end if
else
rsexd("exd")=0 '修改表exd字段的值
end if
rsexd.movenext
loop
rsexd.updateBatch '批量递交
rsexd.close
end if
%>
%>
<%
set rsexd=server.CreateObject("adodb.recordset")
sqlexd="select * from corporation "
rsexd.open sqlexd,conn,1,4 '批量递交
if not (rsexd.eof and rsexd.bof) then
do while not rsexd.eof
if rsexd("EndDate").value<>"" Or IsNull(rsexd("EndDate").value) then
if DateDiff('d',rsexd("EndDate").value,date())<0 then
rsexd("exd")=0 '修改表exd字段的值
else
rsexd("exd")=1 '修改表exd字段的值
end if
else
rsexd("exd")=0 '修改表exd字段的值
end if
rsexd.movenext
loop
rsexd.updateBatch '批量递交
rsexd.close
end if
%>
set rsexd=server.CreateObject("adodb.recordset")
sqlexd="select * from corporation "
rsexd.open sqlexd,conn,1,3
if not rsexd.eof then
do while not rsexd.eof
if rsexd("EndDate")<>"" then
if rsexd("EndDate")>date() then
rsexd("exd")=0 '修改表exd字段的值
else
rsexd("exd")=1 '修改表exd字段的值
end if
else
rsexd("exd")=0 '修改表exd字段的值
end if
rsexd.update '这里修改了,还是不可以
rsexd.movenext
loop
rsexd.close
end if
sql = "UPDATE corporation SET exd=0 WHERE EndDate='' OR EndDate IS Null;" &_
"UPDATE corporation SET exd=0 WHERE DateDiff(d,EndDate,getDate())<0;" &_
"UPDATE corporation SET exd=1 WHERE DateDiff(d,EndDate,getDate())>=0;"
conn.execute sql