Hola
Yo cambiaría esto:
CASE WHEN ISNULL(SUM(T0.TOTALSINIVA),0) = 0 THEN 0 ELSE
Un saludo
Agustín
Avalados por :
¿Cómo estás? ¿Podrían ayudarme con esta consulta? Por más que la he modificado, no logro quitar ese error:
SELECT
T0.NOMES,
T0.SERIESNAME AS 'SUCURSAL',
T0.SLPCODE,
T0.SLPNAME,
T0.CardCode,
T0.CardName,
T1.U_IMPORTE 'OBJETIVO MES',
T1.U_OBJETIVOMU 'OBJETIVO MU',
SUM(ISNULL(T0.TOTALSINIVA,0)) AS 'VENTA NETA', SUM(ISNULL(T0.UTILIDAD,0)) AS 'MU',
CASE WHEN SUM(T0.TOTALSINIVA)=0 THEN 0 ELSE
(SUM(ISNULL(T0.UTILIDAD,0))/SUM(ISNULL(T0.TOTALSINIVA,0)))*100 END AS 'PORCENTAJE MU',
(SELECT ISNULL(SUM(T5.DOCTOTAL),0) AS 'VENCE' FROM OINV T5
WHERE T5.CardName=T0.CARDNAME AND MONTH(T5.DocDueDate)=T0.NOMES AND T5.SlpCode=T0.SLPCODE) AS 'SI VENCE',
(SELECT ISNULL(SUM(T5.DocTotal)-(SUM(T5.DOCTOTAL)-SUM(PaidToDate)) ,0) AS 'RECUPERADO' FROM OINV T5
WHERE T5.CardName=T0.CARDNAME AND MONTH(T5.DocDueDate)=T0.NOMES AND T5.SlpCode=T0.SLPCODE
Hola
Yo cambiaría esto:
CASE WHEN ISNULL(SUM(T0.TOTALSINIVA),0) = 0 THEN 0 ELSE
Un saludo
Agustín
contacto@primeinstitute.com
(+51) 1641 9379
(+57) 1489 6964
© 2024 Copyright. Todos los derechos reservados.
Desarrollado por Prime Institute