28,406
社区成员
发帖
与我相关
我的任务
分享sj(0)="1"
sj(1)="2"
sj(2)="3"
for i=0 to 2
set rs=server.CreateObject("ADODB.RecordSet")
set rs.ActiveConnection=conn
rs.CursorType=3
sql="if exists (select count(*) FROM XZB_RYChange where (日期 = '"&b&"') and (时间段序号='"&sj(i)&"') and (JZcode='4')>0) select 值长,班长,主控 FROM XZB_RYChange where (日期 = '"&b&"') and (时间段序号='"&sj(i)&"') and (JZcode='4' else SELECT 值长,班长,主控 FROM XZB_TempLate where (日期 = '"&b&"') and (时间段序号='"&sj(i)&"') and (JZcode='4')"
rs.open sql,conn
if rs.eof and rs.bof then
else
for j=0 to 2
renyuan4(i,j)=rs.fields(j).value
next
rs.close
end if
set rs = nothing sj(0)="1"
sj(1)="2"
sj(2)="3"
for i=0 to 2
set rs=server.CreateObject("ADODB.RecordSet")
set rs.ActiveConnection=conn
rs.CursorType=3
sql="SELECT 值长,班长,主控 FROM XZB_TempLate where (日期 = '"&b&"') and (时间段序号='"&sj(i)&"') and (JZcode='4')"
rs.open sql,conn
if rs.eof and rs.bof then
else
for j=0 to 2
renyuan4(i,j)=rs.fields(j).value
next
end if
rs.close
set rs = nothing
nextsj(0)="1"
sj(1)="2"
sj(2)="3"
for i=0 to 2
if where="" then
where=" 时间段序号='"&sj(i)&"' "
else
where=where&" or 时间段序号='"&sj(i)&"' "
end if
next
sql="SELECT 值长,班长,主控 FROM XZB_TempLate where (日期 = '"&b&"') and ("& where &") and (JZcode='4')" set rs=server.CreateObject("ADODB.RecordSet")
set rs.ActiveConnection=conn
rs.CursorType=3
sql="select 值长,班长,主控 FROM XZB_RYChange where (日期 = '"&b&"') and (时间段序号='"&sj(i)&"') and (JZcode='4')"
rs.open sql,conn
if rs.eof and rs.bof then
sql="SELECT 值长,班长,主控 FROM XZB_TempLate where (日期 = '"&b&"') and (时间段序号='"&sj(i)&"') and (JZcode='4')"
if rs.eof and rs.bof then
else
for j=0 to 2
renyuan4(i,j)=rs.fields(j).value
next
end if
else
for j=0 to 2
renyuan4(i,j)=rs.fields(j).value
next
end if
rs.close
set rs = nothing