Sobres Entregados
Sobres Devueltos
Entregas Verificadas
Entregas Realizadas Correctamente
Mala Atencion - Queja del Cliente
No Identifico al Destinatario
Entrego Sobre Abierto y sin Cubierta Plastica
Acuse de Recibo llenado por el Distribuidor
Devoluciones Verificadas
A
B
C
D
E
F
A
B
C
D
Devoluciones Verificadas
E
Entregas Realizadas Correctamente
Entrego Sobre Abierto y sin Cubierta Plastica
F
Mala Atencion - Queja del Cliente
No Identifico al Destinatario
Sobres Devueltos
Sobres Entregados
REGION CodRegion
Capital 1
Centro 2
Oriente 3
Occidente 4
Zulia-Occidente 5
¿será que le agrego un campo más a la tabla, pero que sea un campo contador?Esa es la primer solucion que se le viene a uno en mente, pero deberia ser la ultima que se toma :D :D :D :D :D .
si tengo que pensar en otra porque ahora que lo veo, el contador tampoco me sirve nosweat.gifpor que decis que no te sirve ??
SELECT A.Asunto AS ASUNTO, COUNT(A.Asunto) AS N_DE_REGISTROS, SUM(A.Cant) AS CANT
FROM DISTMASIVA_GESTCALIDAD_DETALLE AS A, TB_REPORTE AS REP
WHERE A.CodRegion = REP.CodRegion
And A.IDSucursal = REP.IDSucursal
And (A.Asunto="Sobres Entregados"
Or A.Asunto="Sobres Devueltos"
Or A.Asunto="Entregas Verificadas"
Or A.Asunto="Entregas Realizadas Correctamente"
Or A.Asunto="Mala Atencion - Queja del Cliente"
Or A.Asunto="No Identifico al Destinatario"
Or A.Asunto="Entrego Sobre Abierto y sin Cubierta Plastica"
Or A.Asunto="Acuse de Recibido llenado por el Distribuidor"
Or A.Asunto="Devoluciones Verificadas"
Or A.Asunto="A"
Or A.Asunto="B"
Or A.Asunto="C"
Or A.Asunto="D"
Or A.Asunto="E"
Or A.Asunto="F")
And A.TipoGestion=2
And A.Fecha>=REP.Fecha1 And A.Fecha<=REP.Fecha2
GROUP BY A.Asunto;
SELECT A.Asunto AS ASUNTO, COUNT(A.Asunto) AS N_DE_REGISTROS, SUM(A.Cant) AS CANT
FROM DISTMASIVA_GESTCALIDAD_DETALLE AS A, TB_REPORTE AS REP
WHERE A.CodRegion = REP.CodRegion
And A.IDSucursal = REP.IDSucursal
And (A.Asunto="Sobres Entregados"
Or A.Asunto="Sobres Devueltos"
Or A.Asunto="Entregas Verificadas"
Or A.Asunto="Entregas Realizadas Correctamente"
Or A.Asunto="Mala Atencion - Queja del Cliente"
Or A.Asunto="No Identifico al Destinatario"
Or A.Asunto="Entrego Sobre Abierto y sin Cubierta Plastica"
Or A.Asunto="Acuse de Recibido llenado por el Distribuidor"
Or A.Asunto="Devoluciones Verificadas")
And A.TipoGestion=2
And A.Fecha>=REP.Fecha1 And A.Fecha<=REP.Fecha2
GROUP BY A.Asunto;
SELECT A.Asunto AS ASUNTO, COUNT(A.Asunto) AS N_DE_REGISTROS, SUM(A.Cant) AS CANT
FROM DISTMASIVA_GESTCALIDAD_DETALLE AS A, TB_REPORTE AS REP
WHERE A.CodRegion = REP.CodRegion
And A.IDSucursal = REP.IDSucursal
And (A.Asunto="A"
Or A.Asunto="B"
Or A.Asunto="C"
Or A.Asunto="D"
Or A.Asunto="E"
Or A.Asunto="F")
And A.TipoGestion=2
And A.Fecha>=REP.Fecha1 And A.Fecha<=REP.Fecha2
GROUP BY A.Asunto;