26-mar-2008, 09:29
|
#2 (permalink)
|
Fecha de Ingreso: febrero-2007
Mensajes: 1.201
|
Re: Consulta condicional
no puedes utilizar un alias en el where.
WHERE ROUND( ((((FACTURACION.Importe_1+FACTURACION.Importe_2+FA CTURACION.Importe_3+FACTURACION.Importe_4+FACTURAC ION.ImpotroIVA)-(FACTURACION.Visados+FACTURACION.Retenciones))*((F ACTURACION.IVA/100)+1))+FACTURACION.ImpsinIVa)- IF(sum(COBROS.Cobrado)>0.01,sum(COBROS.Cobrado), 0) ,2)>0
Si lo dejas asi, le he quitado el parentesis que envuelve el round deberia funcionar.
Si no te funciona hazlo con una subconsulta, que quizas sea más rapido que meter todo el calculo en el where.
Salu2
|
|
|