Jump to content
Fórum Script Brasil
  • 0

ORDENAR CAMPOS DO FORMULARIO/CONSULTA SQL [ASP CLASSICO]


Gabriel Gontijo

Question

BOM DIA PESSOAL, AGORA PRECISO DA AJUDA DE vocês PARA PODER ORDENAR OS CAMPOS DE UMA CONSULTA.......... SEGUE O FONTE LOGO ABAIXO....

OBRIGADO PELA ATENÇÃO!!!

SEGUE FONTE:

<td height=""><table width="100%" border="0" cellpadding="1" cellspacing="1" class="HeaderForm">

<%

order = "lote"

if(Request.QueryString("order") <> "") then

order = Request.QueryString("order")

end if

if(Request.QueryString("atual") = Request.QueryString("order")) then

if Request.QueryString("sentido") = "" then

sentido = " desc"

else

sentido = ""

end if

end if

%>

<tr>

<td class="4%"><a href="?order=codlote&atual=<%=Request.QueryString("order")%>&sentido=<%=sentido%>">Lote</a></td>

<td width="4%">Item</td>

<td width="35%">Descrição</td>

<td width="9%">Valor</td>

<td width="8%">Comissão</td>

<td width="7%">Taxa</td>

<td width="8%">Total</td>

<td width="15%">Arrematante</td>

<td width="10%">Status</td>

</tr>

</table></td>

</tr>

<tr>

<td height="140" valign="top" class="BorderTable">

<div style="height:150px; overflow:auto;">

<table width="100%" border="0" cellpadding="1" cellspacing="1">

<%

sql = ""

sql = sql & "SELECT t1.*, t2.descnota, t3.nome FROM leiloes_apuracao t1 LEFT JOIN lotes t2 ON t2.CodLeilao = t1.CodLeilao AND t2.Lote = t1.Lote AND t2.item = t1.item LEFT JOIN arrematantes t3 ON t3.codArrematante = t1.CodArrematante WHERE t1.Codleilao = " & CodLeilao & " order by " + order + setindo

' response.Write sql

'response.End()

set rs = conn.execute(sql)

session("sqlAux")= sql

Do Until rs.eof

%>

<tr >

<td class="BorderTable" width="4%"><a href="?codleilao=<%=rs("codleilao")%>&lote=<%=rs("lote")%>&item=<%=rs("item")%>"><%=zeros(rs("Lote"),4)%></a></td>

<td class="BorderTable" width="4%"><%=zeros(rs("Item"),3)%></td>

<td class="BorderTable" width="35%"><%=rs("descnota")%></td>

<td class="BorderTable" width="9%"><%=formatnumber(rs("Valor"),2)%></td>

<td class="BorderTable" width="8%"><%=formatnumber(rs("comissao"),2)%></td>

<td class="BorderTable" width="7%"><%=formatnumber(rs("taxa"),2)%></td>

<td class="BorderTable" width="8%"><%=formatnumber(rs("total"),2)%></td>

<td class="BorderTable" width="15%"><%=rs("nome")%></td>

<td class="BorderTable" width="10%"><%=rs("Situacao")%></td>

</tr>

<%

Rs.movenext

loop

rs.close

set rs = nothing

%>

</table>

</div>

</td>

</tr>

</table>

DETALHE, QUANDO CLICO NO TITULO ELE SOME COM OS DADOS DA TELA.......

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...