You'll wind up with data like:
John Srv1
Joe Srv14
Joe Srv2
Matt Srv3
John Srv4
Matt Srv6
Throw in an order by clause, ORDER BY PrimaryTech,ServerName so you have
data like:
Joe Srv14
Joe Srv2
John Srv1
John Srv4
Matt Srv3
Matt Srv6
Unfortunately, when you write out tables in HTML, your only option is to go
left to right, and top to bottom. You can't do columns at a time. So, then
the question becomes an HTML design issue. If you want to keep this all in
one query, as opposed to executing a query for each person, you could do
something like:
<table border="1">
<tr>
<%
Dim sOldname, sCurrentname
sOldname = ""
Do while not yourRecordset.EOF
sCurrentname = yourRecordset.Fields.Item("PrimaryTech").Value
If sCurrentname <> sOldname Then Response.Write "<td>"
Response.Write yourRecordset.Fields.Item("ServerName").Value & "<br>"
sCurrentname = yourRecordset.Fields.Item("PrimaryTech").Value
If sCurrentname <> sOldname Then
Response.Write "<td>"
Response.Write sCurrentname & "<br>"
End If
Response.Write yourRecordset.Fields.Item("ServerName").Value & "<br>" &
vbCrLf
yourRecordset.MoveNext
sOldname = sCurrentname
sCurrentname = yourRecordset.Fields.Item("PrimaryTech").Value
If sCurrentname <> sOldname Then Response.WRite "</td>"
Loop
%>
</tr>
</table>
Ray at work
"CD" <mc****@hotmail.REMOVETHIS.com> wrote in message
news:eD**************@TK2MSFTNGP15.phx.gbl...
I would like some guidance as to how to proceed to build a webpage in asp
or aspx. I am going to hit a SQL db needing to get the following data:
SELECT ServerName,PrimaryTech FROM tblservers GROUP BY
PrimaryTech,ServerName
The idea is to display the data in a table format where the Column header
would the PrimaryTech and under each tech would the ServerName they are
responsible for.
ie.....
John Matt Joe
Srv1 Srv3 Srv2
Srv4 Srv6 Srv14
TIA
CD