
08/09/2003, 11:02
|
| | Fecha de Ingreso: julio-2003 Ubicación: mi camioneta?
Mensajes: 87
Antigüedad: 21 años, 9 meses Puntos: 0 | |
Otra version Hola.
Haber si te sirve este codigo, no lo he probado.
<%NxSQL ="SELECT gastos, nombre FROM neox Order BY nombre"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open NxSQL, oConn,3,1
%>
<table width="720" border="1" cellpadding="0" cellspacing="1">
<tr bgcolor="#FFFFFF">
<td width="50%">Nombre</td>
<td>Gastos</td>
</tr>
<%do while not Rs.eof%>
<%
total = 0
Nxx = Rs.Fields("Nombre")
do while Rs.Fields("nombre")=Nxx
total = total + cInt(rs.Fields("gastos"))
%>
<tr bgcolor="#FFFFFF">
<td height="22">
<%=RS("nombre")%>
</td>
<td>
<%=RS("gastos")%>
</td>
</tr>
<%
Rs.MoveNext
loop
%>
<tr bgcolor="#FFFFFF">
<td height="22">
<div align="right">
<b>Total=
</div>
</td>
<td>
<b><%=total%>
</td>
</tr>
<%loop%>
</table>
<%
RS.Close
Set RS = Nothing
oConn.Close
Set oConn = Nothing
%>
Saludos |