Files
MBS/PROYECTO/acdir/calcula.sql
T

13 lines
497 B
SQL

select unique sum(valor+monto_desc) FACTURAS from cctb00001
where fecha_orig between "010398" and "310398"
and tipo_doc in ("FT","FE","ND") and status_t is null
;
select unique sum(valor+monto_desc) pagos from cctb00001
where fecha_orig between "010398" and "310398"
and tipo_doc in ("PG","NC") and status_t is null
;
select unique sum(valor+monto_desc) avances from cctb00001
where fecha_orig between "010398" and "310398"
and tipo_doc in ("AV") and status_t is null and num_doc = aplica_a