
10/04/2007, 21:21
|
 | Colaborador | | Fecha de Ingreso: febrero-2007 Ubicación: Cantando "Screenager" en "Kirafa Kaput"
Mensajes: 3.614
Antigüedad: 18 años, 1 mes Puntos: 88 | |
Re: Sumar registros filtrados !! te podria servir esto??
Código:
<%
dim oConn,RS
set oConn=server.CreateObject("ADODB.Connection")
set RS=server.CreateObject("ADODB.Recordset")
strcxn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.MapPath("another.mdb")
'C:\mydatabase.mdb;User Id=admin;Password=;"
oConn.open strcxn
SQL="select cliente, item, cantidad from articulos where item=9090 order by cliente ASC;"
RS.open SQL, oConn, 3, 3
monto=0
cont=0
if Err=0 then
while RS.EOF=FALSE
cont=cont+1
if temp="" then temp=RS("cliente").value end if
if temp=RS("cliente").value then
monto=monto+int(RS("cantidad").value)
else
response.Write "El cliente :"&temp&"; contador "&cont&" monto"&monto&"<br/>"
monto=0
cont=0
temp=RS("cliente").value
monto=monto+int(RS("cantidad").value)
end if
RS.movenext
wend
end if
RS.close
oConn.close
set RS=nothing
set oConn=nothing
%>
__________________ "Eres parte del problema, parte de la solucion o parte del paisaje" Un Saludo desde Desierto de Altar, Sonora, MX. Shiryu_libra |