hola FOURIER nuevamente
Aqui he ordenado un poquitin la consulta... la he ingresado, pero me ha dado error en la linea 10, posicion 1...
Aqui la imagen del error, con el mensaje... como que no conoce alguna sentencia...
http://img231.imageshack.us/img231/5...userror3xp.jpg
Código SQL
[-]
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 = 2
ORDER BY CLIENTE.APELLIDO ASC, CLIENTE.ESTABLECIMIENTO ASC
Me pregunto como podria hacer para enviarte las estructura de las tablas para que puedas probar, ya que yo uso el motor NEXUS...
www.nexusdb.com
Si quieres, armo las tablas en mySQL o en algun formato que digas y te las envio... (no se si con registros de ejemplo, ya que nexus no posee ninguna utilidad para exportar o convertir las tablas, ni registros)
Muchas gracias por tu ayuda