Ver Mensaje Individual
  #4  
Antiguo 06-05-2022
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.561
Reputación: 25
egostar Va camino a la fama
Hola

Como lo menciona Casimiro, si muestras como haces la llamada en código Delphi ayudaría, sin embargo, obviando dicho código yo suelo incluir la función COALESCE() cuando se trata de operaciones aritméticas y de concatenación.

Código SQL [-]
SELECT 
  P.PROV_RIF, 
  P.PROV_NOMBRE, 
  P.PROV_BANCO, 
  SUM(COALESCE(D.DPA_MONTO,0) + 
      COALESCE(D.DPA_IVA, 0) - 
      COALESCE(D.DPA_IAE, 0) - 
      COALESCE(D.DPA_ISLR, 0) ) AS TOTMONTO 
FROM 
  PROVEEDOR P 
  INNER JOIN DET_PAGO D ON P.PROV_RIF= D.DPA_RIF
WHERE 
  D.DPA_FECPAG IS NULL 
  AND 
  D.DPA_AUTORI IS NOT NULL
GROUP BY 1,2,3

Saludos
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita