%
dim conn_xk
dim conn_xkstr
conn_xkstr="DBQ="+server.mappath("xk/xk.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn_xk=server.createobject("ADODB.CONNECTION")
conn_xk.open conn_xkstr
set rt = server.createobject("adodb.recordset")
sql="select top 1 a.*,b.*,c.*,d.* from ((cod as a left join tn as b on a.times=b.times) left join tp as c on a.times=c.times) left join t7 as d on a.times=d.times order by a.times desc"
rt.open sql,conn_xk,1,3
if not rt.eof then
dim codvalue
dim tnvalue
dim tpvalue
codvalue=rt("codvalue")
codrank=rt("codrank")
tnvalue=rt("tnvalue")
tnrank=rt("tnrank")
tpvalue=rt("tpvalue")
tprank=rt("tprank")
codrule=rt("codrule")
tnrule=rt("tnrule")
tprule=rt("tprule")
t7=rt("t7")
high=rt("high")
rt.close
itemp1=DateSerial(Year(date), month(date)-1, 1)
itemp2=DateSerial(Year(date), month(date)-1, 30)
sql="select top 1 a.*,b.*,c.* from (cod as a left join tn as b on a.id=b.id) left join tp as c on a.id=c.id where a.times between #"&itemp1&"# And #"&itemp2&"# order by a.times desc"
rt.open sql,conn_xk,1,3
if not rt.eof then
codmax=rt("codvalue")
tnmax=rt("tnvalue")
tpmax=rt("tpvalue")
rt.close
itemp1=DateSerial(Year(date), month(date)-1, 1)
itemp2=DateSerial(Year(date), month(date)-1, 30)
sql="select top 1 a.*,b.*,c.* from (cod as a left join tn as b on a.id=b.id) left join tp as c on a.id=c.id where a.times between #"&itemp1&"# And #"&itemp2&"# order by a.times"
rt.open sql,conn_xk,1,3
codmin=rt("codvalue")
tnmin=rt("tnvalue")
tpmin=rt("tpvalue")
rt.close
if codmin<1 then codmin="0"&codmin
if tnmin<1 then tnmin="0"&tnmin
if tpmin<1 then tpmin="0"&tpmin
if tpmax<1 then tpmax="0"&tpmax
if tnmax<1 then tnmax="0"&tnmax
if codmax<1 then codmax="0"&codmax
end if
if codvalue<1 then codvalue="0"&codvalue
if tnvalue<1 then tnvalue="0"&tnvalue
if tpvalue<1 then tpvalue="0"&tpvalue
end if
%>
白溪水库
<%
conn_xk.close
%>