ASP - Ayuda para una consulta de datos ASP

 
Vista:

Ayuda para una consulta de datos ASP

Publicado por Luis Cabllero (1 intervención) el 05/06/2006 17:40:11
Mi codigo es el siguiente
Code:
<html>
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>

<! #INCLUDE File="ADOJAVAS.inc"-->
<title>LISTAS DE CONTROL</title>

<HEAD>

</HEAD>

<BODY>

<%

Ob_Conn=new ActiveXObject ("ADODB.Connection");
Ob_Conn.Open ("Provider=MSDASQL.1;Password=masterkey;Persist Security Info=True;User ID=sysdba;Data Source=lista")
%>


<%Ob_RS6=Ob_Conn.Execute ("SELECT DISTINCT (lifnr) from controles where EXTRACT(YEAR FROM fch_control)='2006' and EXTRACT(month FROM fch_control)='9' order by lifnr ")%>

<TABLE width="300" BORDER=1>

<th width="200"><span class="Estilo2">Codigo SAP </span></th>
<th width="50"><span class="Estilo2">Nº Controles</span></th>
<tr>

<%while (!Ob_RS6.Eof)
{%>
<%Ob_RS7=Ob_Conn.Execute ("SELECT count (lifnr) as cont from controles where lifnr='"+Ob_RS6("LIFNR")+"' and EXTRACT(YEAR FROM fch_control)='2006' and EXTRACT(month FROM fch_control)='9'")%>


<TD class="Estilo2"><div align="center"> <%=Ob_RS6("lifnr")%></div></TD>
<TD class="Estilo2"><div align="center"><%=Ob_RS7("cont")%> </div></TD>
<tr>

<%Ob_RS6.MoveNext()}%>

</TABLE>


</BODY>
</HTML>
<%
Ob_RS7.Close()
Ob_RS6.Close()
Ob_Conn.Close() %>



El resultado que me da es el siguente
Codigo SAP Nº Controles
941---------->1
3082----------> 2
3274----------> 1
3353----------> 2
3518----------> 3
7146----------> 1
7157----------> 1
7366----------> 1
10418----------> 2
15034----------> 2
16643----------> 2
21110----------> 1

como se ve me los ordena por lifnr(codigo SAP), quiero saber como los puedo ordenar por Nº de Controles

Desde ya muchas grax y muy buena pagina me a ayudado mucho
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder