<%
Dim connc
fac_server="ora9"
uid1="ytcx"
pwd1="scytcx"
set connc = server.createobject("Adodb.Connection")
connc.Open "Provider=OraOLEDB.Oracle.1;Persist Security Info=True;Password="&pwd1&";User ID="&uid1&";Data Source="&fac_server&""
%>
<%on error resume next
dim aa1(600),jh1(600),jingh(600),dbb(600),riqii(600),shij(600),dymcc(600),cengw(600),gany(600),youy(600),taoy(600),peiz(600),shiz(600),cds(600),beiz(600),qsz(600),cz(600)
dim riqi1,riqi2,pz,shz,js,bd1,bd2
bd1=request.form("db1")
bd2=request.form("db2")
y1=request.form("year1")
m1=request.form("month1")
d1=request.form("day1")
y2=request.form("year2")
m2=request.form("month2")
d2=request.form("day2")
riqi1=y1&m1&d1
riqi2=y2&m2&d2
%>
<%
'取井号
exec1="select distinct JH from YS_DBA02 where (DWDM like '3020046%' or DWDM like '3020047%') order by JH"
Set RS1= Server.CreateObject("ADODB.RecordSet")
rs1.Open exec1,Connc,1,2
i=0
do while not rs1.eof
if rs1("JH")<>"" and rs1("JH")<>"0" then
jh1(i)=rs1("JH").value
i=i+1
end if
rs1.movenext
loop
rs1.close
set rs1=nothing
numb=i
i=0
for j=0 to numb-1
exec2="select rzsl from YS_DBA02 where JH='"&jh1(j)&"' and (DWDM like '3020046%' or DWDM like '3020047%') and to_char(rq,'yyyymmdd')='"&riqi1&"'"
Set RS2= Server.CreateObject("ADODB.RecordSet")
rs2.Open exec2,Connc,1,2
exec3="select * from YS_DBA02 where JH='"&jh1(j)&"' and (DWDM like '3020046%' or DWDM like '3020047%') and to_char(rq,'yyyymmdd')='"&riqi2&"'"
Set RS3= Server.CreateObject("ADODB.RecordSet")
rs3.Open exec3,Connc,1,2
if not rs2.eof and not rs3.eof then
aa1(i)=abs(formatnumber(rs3("RZSL"))-formatnumber(rs2("RZSL")))
'response.write formatnumber(aa)
'response.write "/"
response.write formatnumber(bd1)
response.write formatnumber(bd2)
'response.write formatnumber(aa1(i))
response.write "/"
if (aa1(i))>=bd1 and (aa1(i))<bd2 then
i=i+1
jingh(i)=rs3("JH")
dbb(i)=rs3("DWMC")
riqii(i)=rs3("RQ")
shij(i)=rs3("SCSJ")
dymcc(i)=rs3("DYMC")
cengw(i)=rs3("ZSCW")
gany(i)=rs3("GXYL")
youy(i)=rs3("YY")
taoy(i)=rs3("TY")
peiz(i)=rs3("RPZSL")
shiz(i)=rs3("RZSL")
cds(i)=rs3("PZCDS")
beiz(i)=rs3("BZ")
qsz(i)=rs2("RZSL")
cz(i)=formatnumber(shiz(i))-formatnumber(qsz(i))
end if
end if
next
num=i
rs2.close
set rs2=nothing
rs3.close
set rs3=nothing
connc.close
set connc=nothing
%>
问题是:
if (aa1(i))>=bd1 and (aa1(i))<bd2 then不起作用
如果直接赋值 if (aa1(i))>=100 and (aa1(i))<1000 then就没有问题
用类型转换 if formatnumber(aa1(i))>=formatnumber(bd1) and formatnumber(aa1(i))<formatnumber(bd2) then也不行