Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 16-05-2004
el_enigma1 el_enigma1 is offline
Miembro
 
Registrado: may 2004
Posts: 57
Poder: 21
el_enigma1 Va por buen camino
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.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:13:32.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi