mil gracias por sus aportes
no he probado coalese
pero me funcionoo de esta manera
Código Delphi
[-]
(
(select sum(importe) from cuem where trim(no_factura) = trim(facm.cve_doc)) -
(select sum(importe) from cued where trim(no_factura) = trim(facm.cve_doc)) <> 0
OR
(select sum(importe) from cuem where trim(no_factura) = trim(facm.cve_doc)) -
(select sum(importe) from cued where trim(no_factura) = trim(facm.cve_doc)) is null
)
saludos