Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 14-12-2005
FOURIER FOURIER is offline
Miembro
 
Registrado: dic 2005
Posts: 40
Poder: 0
FOURIER Va por buen camino
Espero que te ayude

SELECT CLIENTE.NROSOCIO AS SOCIO, CLIENTE.NOMBRE AS CLIENTE, CLIENTE.APELLIDO AS APELLIDO, CLIENTE.ESTABLECIMIENTO AS ESTABLECIMIENTO, (select SUM(case when espromoesp=true then 0 else FACTURACION.MONTO end) from Facturacion as F where Facturacion.idcliente=cliente.id) AS M_NORMAL, (select SUM(case when espromoesp=true then FACTURACION.MONTO else 0 end) from facturacion as F where Facturacion.idcliente=cliente.id) AS M_ESPECIAL, (select SUM(FACTURACION.MONTO) from Facturacion as where Facturacion.idcliente=cliente.id) AS TOT_MONTO, (select sum(facturacion.puntos) from Facturacion where idcliente=cliente.id) as Totalpuntos,(SELECT SUM(B.TOTALPUNTOS) FROM CANJE B WHERE B.IDCLIENTE = cliente.id) as canjea,totalpuntos-canjea as puntos_actuales FROM CLIENTE where cliente.idpromo = :IDPROMO ORDER BY CLIENTE.APELLIDO ASC, CLIENTE.ESTABLECIMIENTO ASC


en fin espero que eso te ayude mi estimado
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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 22:47:13.


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