select sum(importe_total),cod_banco,vto_pago from facturas
   where tipo_doc_pago="1"
   and vto_pago > "1/1/98"
group by cod_banco,vto_pago
order by vto_pago, cod_banco

select sum(importe_total),f_pago,tipo_doc_pago from facturas
   where f_pago > "1/1/97"
   and tipo_doc_pago between "1" and "2"
   and vto_pago is null
group by tipo_doc_pago,f_pago
order by f_pago, tipo_doc_pago

select sum(importe_total),cod_banco,vto_pago
from facturas
where vto_pago is not null and vto_pago > "01/10/97"
 and tipo_doc_pago = "1"
 group by cod_banco,vto_pago
order by vto_pago,cod_banco


select sum(importe_total),f_pago
FROM facturas,proveedores
WHERE f_pago > "1/1/97" and
   facturas.nif=proveedores.nif  and
   f_emision_pago is null and
   tipo_doc_pago between "1" and "2"  and
   ( proveedores.cond_pago = "99" or facturas.cond_pago = "99" )
GROUP BY f_pago
ORDER BY f_pago



