Gracias
Gracias por tu respuesta la verdad no confundia una funcion con otra lo que qeria era esto
Select Sum(importe) as Importe2
from TFactura, TDetalle
Where TFactura.FACTURANUMERO = TDetalle.FACTURANUMERO
And extract(Year from fecha )= 2004
And extract(month from Fecha) = 5
And extract(day from fecha) >= 22
And estado = 'POR COBRAR'
Select Sum(importe) as Importe2
from TFactura, TDetalle
Where TFactura.FACTURANUMERO = TDetalle.FACTURANUMERO
And extract(Year from fecha )= 2004
And extract(month from Fecha) = 5
And extract(day from fecha) >= 15 and extract(day from fecha) <= 21
And estado = 'POR COBRAR'
Select Sum(importe) as Importe2
from TFactura, TDetalle
Where TFactura.FACTURANUMERO = TDetalle.FACTURANUMERO
And extract(Year from fecha )= 2004
And extract(month from Fecha) = 5
And extract(day from fecha) >= 8 and extract(day from fecha) <= 14
And estado = 'POR COBRAR'
Select Sum(importe) as Importe2
from TFactura, TDetalle
Where TFactura.FACTURANUMERO = TDetalle.FACTURANUMERO
And extract(Year from fecha )= 2004
And extract(month from Fecha) = 5
And extract(day from fecha) <= 7
And estado = 'POR COBRAR'
Que la verdad si no veo tu codigo no lo hubiera solucionado o al menos no tan pronto, dejo de mostrar las fechas para solo obtener los totales y creo que para obtener las fechas y el Numero de factura hago un procedure donde busque primero estos y luego en dentro del do pogo los select de aqui arriba bueno voy a probar a ver que tal.
|