<%
'Create recordset
Dim sql, objRS
sql = "SELECT tblGeneral.ChartID, tblGeneral.City, tblGeneral.State, " & _
"tblSpace.SpaceAll, tblSpace.SpacePERC " & _
"FROM tblGeneral INNER JOIN tblSpace ON tblGeneral.ChartID= tblSpace.ChartID " & _
"WHERE tblGeneral.VISNID LIKE '12' "
If Request.querystring("sort") = "" then
sql = sql & "ORDER BY City"
Else
sql = sql & "ORDER BY " & Request.querystring("sort")
End If
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open sql, objConn
'First, display the TABLE header info:
Response.Write "<TABLE class='CCTable' cellspacing='0' border='1' cellpadding='5' width='350px'>"
'Display table headings for each column in the Recordset
Dim rowHeader, rowAll, rowPerc
rowHeader = "<TR style='background-color:white;'><td> </td>"
rowAll = "<TR style='background-color:white;'><td><b>Space</b></td>"
rowPerc = "<TR style='background-color:white;'><td><b>PERC</b></td>"
While Not objRS.EOF
rowHeader = rowHeader & "<th scope='col'>" & objRS("City") & " </th>" & VbCrLf
rowAll = rowAll & "<TD scope='row'>" & objRS("SpaceAll") & " </TD>" & VbCrLf
rowPerc = rowPerc & "<TD scope='row'>" & objRS("SpacePERC") & " </TD>" & VbCrLf
'Advance the recordset
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
rowHeader = rowHeader & "</tr>" & VbCrLf
rowAll = rowAll & "</tr>" & VbCrLf
rowPerc = rowPerc & "</tr>" & VbCrLf
Response.Write rowHeader
Response.Write rowAll
Response.Write rowPerc
Response.Write "</TABLE></div>" & vbCrLf
%>
|