%@ LANGUAGE="VBScript" %>
<%
Run=CLng(Request("run"))
If Run<0 Or Run>999999 Then
Run=999999
End If
run_long=CStr(run)
For i=0 to 5-len(run_long)
run_long="0" & run_long
Next
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Mode = adModeRead
Connection.Open phdb_rd
SQLStmt = "select histogram_group,file_name,description from phoffline.offline_histograms where active=1 "
SQLStmt = SQLStmt & " and (run_valid,file_name) in (select max(run_valid),max(file_name) from "
SQLStmt = SQLStmt & " (select run_valid,active,file_name from phoffline.offline_histograms where run_valid<=" & CStr(run) & ") "
SQLStmt = SQLStmt & " group by file_name) order by histogram_group,file_name"
Set RS = Connection.Execute(SQLStmt)
' response.write(SQLStmt & "
" & vbCrLf)
%>
<%
group_old="XXXXXX"
Do While Not RS.EOF
If CStr(RS("histogram_group"))<>group_old Then
If group_old<>"XXXXXX" Then
response.write("" & vbCrLf)
End If
response.write("" & RS("histogram_group") & "
" & vbCrLf)
response.write("