Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/09/2008, 13:33
chelodelsur
 
Fecha de Ingreso: abril-2008
Mensajes: 208
Antigüedad: 16 años, 1 mes
Puntos: 2
Respuesta: Problemas con IFNULL????

Hola

Por si a sirve para alguien, solucioné el problema del IFNULL IFNULL( T1.eval, '0' )AS EVALUACIONES, (que por alguna razón se peleó con VB) y lo cambien por sum(if(t1.eval='',a.nombre_agente ,t1.eval)) Evaluaciones y asunto arreglado


Código:
 rs.Open "SELECT a.Nombre_agente AGENTES, a.Empleador_agente EMPRESA," _
                   & " a.Estado ESTADO , a.tipo_turno TURNO," _
                   & "sum(if(t1.eval='',a.nombre_agente ,t1.eval)) Evaluaciones " _
                   & "FROM callcapture.agentes a " _
                   & "LEFT JOIN (SELECT a.Nombre_agente na, COUNT( e.agente_evaluado ) eval  " _
                   & "FROM callcapture.agentes a " _
                   & "INNER JOIN callcapture.evaluaciones e ON a.Nombre_agente = e.agente_evaluado " _
                   & "WHERE e.fecha_evaluacion " _
                   & "" & Vfechadesde & " " _
                   & "" & Vfechahasta & " " _
                   & "GROUP BY a.nombre_agente )T1 ON a.Nombre_agente = T1.na " _
                   & "WHERE " _
                   & "" & VEmpresaAgente & "" _
                   & "" & VEstadoAgente & "" _
                   & "" & VTipoTurno & "" _
                   & "GROUP BY a.id_agente " _
                   & "ORDER BY a.Nombre_agente ", cnn, adOpenKeyset, adLockOptimistic