%@ LANGUAGE="VBScript" %>
<%
If Not IsEmpty(request.form("Close")) Then
%>
<%
End If
timedate=Request("timedate")
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Mode = adModeRead
Connection.Open phdb_rd
If timedate="" Or IsEmpty(request.form("Selected_Time")) Then
SQLStmt = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual "
Set RS = Connection.Execute(SQLStmt)
timedate = CStr(RS("timedate"))
Set RS=nothing
End If
If Not IsDate(timedate) Then
message="Wrong Time/Date format " & timedate
%>
<%
End If
timedate_par=replace(timedate," ","%20")
%>
BLM and Chipmunk Monitoring Status
<%
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Connection
SQLStmt = " select bc.blm_position,bm.blm_name,to_char(bm.startdate,'MM/DD/YYYY HH24:MI:SS') startdate, "
SQLStmt = SQLStmt & " nvl(blm_sp.nspikes,0) nspikes, "
SQLStmt = SQLStmt & " to_char(bm.stopdate,'MM/DD/YYYY HH24:MI:SS') stopdate,bm.stopdate-bm.startdate dt,round((bm.stopdate-bm.startdate)*24*60,0) dtm,dose,blm_status, "
SQLStmt = SQLStmt & " 24*60*(to_date( ? ,'MM/DD/YYYY HH24:MI:SS') -bm.stopdate)+(1-nvl(bm.missed_data,0))/60 ddif "
SQLStmt = SQLStmt & " from phoffline.blm_monitoring bm,phoffline.blm_config bc, "
SQLStmt = SQLStmt & " (select max(startdate) startdate,max(blm_name) blm_name from phoffline.blm_monitoring "
SQLStmt = SQLStmt & " where startdate between to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-2 and to_date( ? ,'MM/DD/YYYY HH24:MI:SS') "
SQLStmt = SQLStmt & " group by blm_name ) blm_date "
SQLStmt = SQLStmt & " , (select blm_name,sum(n_over_th) nspikes from phoffline.blm_spikes "
SQLStmt = SQLStmt & " where startdate between to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-2 and to_date( ? ,'MM/DD/YYYY HH24:MI:SS') "
SQLStmt = SQLStmt & " group by blm_name ) blm_sp "
SQLStmt = SQLStmt & " where bm.startdate=blm_date.startdate "
SQLStmt = SQLStmt & " and bm.blm_name=blm_date.blm_name and bc.blm_name=bm.blm_name "
SQLStmt = SQLStmt & " and bm.blm_name=blm_sp.blm_name(+) "
SQLStmt = SQLStmt & " and bm.startdate between bc.startdate and bc.stopdate "
SQLStmt = SQLStmt & " order by bc.blm_position "
Cmd.CommandText = SQLStmt
Cmd.CommandType = 1
for i=0 To 4
Set prm = cmd.CreateParameter("Input" & CStr(i),adBSTR,adParamInput,20,timedate)
Cmd.Parameters.Append prm
Set prm=nothing
Next
' For Each p In Cmd.Parameters
' Response.Write(p.Name & " = " & p.Value & " ")
' Next
Set RS = Cmd.Execute()
response.write(RS("startdate"))
Connection.Close
Set RSC=nothing
Set Connection=nothing
%>