<%
'---Create recordset
Dim sql, objRS, s_name, s_order, s_next_order
sql = "SELECT Complexity, count(*) as ComplexityCount, " & _
"Avg( LibFTE ) as AvgLibFTE " & _
"FROM tblGeneral INNER JOIN tblStaff ON tblGeneral.ChartID= tblStaff.ChartID " & _
"WHERE AllHCF = 'YES' " & _
"GROUP BY Complexity "
s_name = Request.querystring("sort")
If Request.Querystring("order") = "1" Then
s_order = "ASC"
s_next_order = 0
Else
s_order = "DESC"
s_next_order = 1
End If
Select Case s_name
Case "Complexity"
sql = sql + "ORDER BY Complexity " + s_order + " "
Case "ComplexityCount"
sql = sql + "ORDER BY Count(*) " + s_order + " "
Case "AvgLibFTE"
sql = sql + "ORDER BY Avg( LibFTE ) " + s_order + " "
End Select
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open sql, objConn
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title><%=title%></title>
<link rel=stylesheet type="text/css" href="/CodeReuse/style.css">
</head>
<body>
<h2 align="left"><font face="Arial" size="4"><%=title%></font></h2>
<p>* Indicates a consolidated facility, no separate complexity level assigned.<br>
Includes only <i>All HCF</i> designated facilities.
</p>
<%
If (objRS.EOF) Then
'---NO ROWS TO DISPLAY
Else
'---DISPLAY ROWS IN A HTML FORMATTED TABLE
%>
<table class="CCTable" cellspacing='0' border='1' cellpadding='5' width='400px>
<TR style='background-color: white;'>
<TH class="CCTable" scope='col' width='150px'><font size='1' color='blue'><a href='?sort=Complexity&order=<%=s_next_order%>'><font color='blue'><b>Complexity<br>Level</b></font></a></th>
<TH class="CCTable" scope='col' width='150px'><font size='1' color='blue'><a href='?sort=ComplexityCount&order=<%=s_next_order%>'><b># of Medical<br>Centers</b></a></font></th>
<TH class="CCTable" scope='col' width='150px'><font size='1' color='blue'><a href='?sort=avgLibFTE&order=<%=s_next_order%>'><b>Average # of<br>FTE</b></a></font></th></TR>
<%
Dim r_complexity, r_complexity_count, r_avgLibFTE
Do While (NOT objRS.EOF)
r_complexity = Trim( objRS("Complexity") )
r_complexity_count = Trim( objRS("ComplexityCount") )
r_complexity_count = Trim( objRS("ComplexityCount") )
r_avgLibFTE = Trim( objRS("avgLibFTE") )
%>
<tr>
<td class="CCTable"><%=r_complexity%> </td>
<td class="CCTable" align="center"><%=r_complexity_count%> </td>
<td class="CCTable" align="center"><%=r_avgLibFTE%> </td>
</tr>
<%
'---MOVE TO NEXT ROW
objRS.MoveNext()
Loop
%>
</table>
<%
End If
'---CLEAN UP
objRS.Close
Set objRS= Nothing
%>
</body>
</html>
|