jon24422531
Technical User
Hi guys
I am running a query against our SQL database:
I get the recordset and display it in a table,
However although I am returning the P.WorkLogNo first (as it is a DISTINCT select) I want to display it in a different order.
Can I change the field order in ASP?
Or should I do the SELECT in to a Table Variable (@Table) and then do the select in a different order?
Jonathan
I am running a query against our SQL database:
Code:
SELECT DISTINCT(P.WorkLogNo) AS [Project ID], U.UserFullName AS Owner, (P.Urgency * P.Priority) AS [Rating], W.FaultType AS [Area], P.Title,
CONVERT(char(20),W.AmendedStamp,0) as [Last Update],
ISNULL(W.LastUser, 'N/A') AS LastUser
from WorkLog_Projects P
JOIN Worklog W on P.WorkLogNo = W.FaultNo
LEFT OUTER JOIN Users U on W.userID = U.UserID
LEFT OUTER JOIN WorkLog_History H on W.FaultNo = H.WorklogNo
I get the recordset and display it in a table,
Code:
<table border='0'>
<tr>
<%
for each fieldItem in rsData.fields
Response.Write vbTab & vbTab &"<td bgcolor=""#EBDDE2""><strong>" & fieldItem.name
Response.Write "</strong></td>" & vbCrLf
next
Response.Write vbTab & "</tr>" & vbCrLf
%>
</tr>
<%
Do While not rsData.EOF
Response.Write "<tr>"
for each fieldItem in rsData.fields
if fieldItem.name = "Project ID" then
Response.Write "<td> <a href=""ProjectAdvanced.asp?id=" & fieldItem.Value & """>" & fieldItem.value & "</a></td>"
else
Response.Write "<td><small> " & fieldItem.value & "</td>"
end if
next
Response.Write "</tr>"
rsData.MoveNext
Loop
%>
</table>
Can I change the field order in ASP?
Or should I do the SELECT in to a Table Variable (@Table) and then do the select in a different order?
Jonathan