
09/04/2008, 13:38
|
 | | | Fecha de Ingreso: marzo-2008 Ubicación: En mi casa
Mensajes: 208
Antigüedad: 17 años, 1 mes Puntos: 5 | |
Re: Proplema con CInt Mmmm a mi se me ocurrio algo asi:
Código:
Set rsRef = Server.CreateObject("ADODB.Recordset")
strSQLrsRef = "SELECT distinct ref FROM detalle"
rsRef.Open strSQLComboCategoria, adoCon, adOpenStatic, adLockOptimistic
'Obtenemos los codigos distinct ref:
EsPrimero = True
Do While NOT rsRef.EOF
If rsRef("distinct ref") <> Referencias Then
If EsPrimero = False Then Referencias = Referencias & ","
Referencias = Referencias & rsRef("distinct ref")
EsPrimero = False
End If
rsRef.MoveNext
Loop
Referencias = Split(Referencias, ",", -1, 1)
'Ahora por cada referencia hacemos una consulta:
For i=1 to uBound(Referencias)
Set rsProductos = Server.CreateObject("ADODB.Recordset")
strSQLrsProductos = "SELECT color, Count([T27]), SUM([T28]), SUM([T29]), SUM([T30]) from detalle WHERE distinct ref=" & Referencias(i)
rsProductos.Open strSQLComboCategoria, adoCon, adOpenStatic, adLockOptimistic
Response.Write(rsProductos("color") & ", " & rsProductos("T27") & ", " & rsProductos("T28") & ", " & rsProductos("T29") & ", " & rsProductos("T30"))
rsProductos.Close
Set rsProductos = Nothing
Next 'i
Aunque es lo mismo que te puso Myakire pero mas tedioso...
Tu decides cual te convenga mas!
Saludos! |