Visual Basic - suma SQL

Life is soft - evento anual de software empresarial
 
Vista:

suma SQL

Publicado por erikur raudi (41 intervenciones) el 04/07/2007 17:30:06
TENGO QUE HACER LA SUMA DE LA INFORMACÍÓN CONTENIDA EN UNA COLUMNA DE MI BD, ESTE ES EL CÓDIGO QUE UTILIZO:

Dim intentos As String
intentos = "SELECT SUM(no_intentos) as resul FROM clientes WHERE is_agente= " & e
bdprosp.RecordSource = intentos
bdprosp.Refresh
LabelIntentos = intentos

1.- NO SE SI REALMENTE ESTE SUMANDO.
2.- QUIERO QUE EL RESULTADO DE ESA SUMA APAREZCA EN LabelIntentos PERO NO LO HACE.

QUE ESTOY HACIENDO MAL?

AGRACEDERIA SUS COMENTARIOS
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

RE:suma SQL

Publicado por Yo (49 intervenciones) el 04/07/2007 19:18:03
No lo va a hacer porque a "LabelIntentos" le estás asignando la CADENA que tratas de ejecutar (intentos), no el resultado.
Prueba así:
LabelIntentos = bdprosp.RecordSet.Fields(0)
porque supongo que "bdprosp" as un ADO DataControl.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar