Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/04/2013, 09:39
Avatar de chris225
chris225
 
Fecha de Ingreso: octubre-2012
Ubicación: Medellin
Mensajes: 149
Antigüedad: 11 años, 6 meses
Puntos: 2
Respuesta: suma el resultados de todos los datos devueltos

Cita:
Iniciado por Libras Ver Mensaje
puedes poner un pequeño ejemplo de lo que regresa tu query?

ya probaste con esto

select campo1+campo2+campo3+campo4 from
(
tu query
) as t1
ya logre reducir el numero de registros lo modifique solo en el where

select (TD.BRUTO - isnull((select (CANTIDAD*VALORUNIT) from MVTRADE where TIPODCTONC in ('NC','NB','NU') and NUMFACTNC=TD.NRODCTO),0)) *
(SELECT (PorcReca/100)FROM GS_Recaudo where (DATEDIFF(day, '2010-01-06','2010-01-07') between Desde and Hasta))
* (select (PorcReca/100) from GS_ConfEscal where Nombre=VE.NOMESCALAFON) as Total
from Trade as TD
inner join GS_Recaudo AS RC on RC.CodeVen = TD.CODVEN
inner join VENDEN AS VE ON VE.CODVEN = RC.CodeVen
left JOIN ABONOS AS AB on AB.FACTURA=TD.NRODCTO AND AB.TIPODCTOCA=TD.TIPODCTO
where TD.TIPODCTO in ('FU','FB','FC') and TD.CODCC=VE.CCOSTOS
and TD.Fecha>='2010-01-06' and TD.Fecha1<='2010-01-06'

devuelve

Total
1551.600000
88137.900000

asi que necesito que me sume estos 2 resultados