Ver Mensaje Individual
  #4  
Antiguo 30-03-2011
Avatar de oscarac
[oscarac] oscarac is offline
Miembro Premium
 
Registrado: sep 2006
Ubicación: Lima - Perú
Posts: 2.010
Reputación: 20
oscarac Va por buen camino
Resuelto

lo resolvi de esta manera....

Código SQL [-]
select M.Periodo, M.Libro, M.Voucher, M.FechaVoucher,  
SUM(iif (M.DH = 'D', M.n_IMP, 0.00 )) AS DEBEMN,  
SUM(iif (M.DH = 'H', M.n_IMP, 0.00 )) AS HABERMN,  
ROUND(SUM(iif (M.DH = 'D', M.n_IMP, 0.00 )) -  SUM(iif (M.DH = 'H', M.n_IMP, 0.00 ))) AS DIFMN,  
SUM(iif (M.DH = 'D', M.u_IMP, 0.00 )) AS DEBEME,  
SUM(iif (M.DH = 'H', M.u_IMP, 0.00 )) AS HABERME,  
ROUND(SUM(iif (M.DH = 'D', M.u_IMP, 0.00 )) -  SUM(iif (M.DH = 'H', M.u_IMP, 0.00 ))) AS DIFME 
from tblmovimientocontable M  
Group by M.Periodo, M.Libro, M.Voucher, M.FechaVoucher  
Having (
ROUND(SUM(iif (M.DH = 'D', M.n_IMP, 0.00 )) -  SUM(iif (M.DH = 'H', M.n_IMP, 0.00 ))) <> 0 or
ROUND(SUM(iif (M.DH = 'D', M.u_IMP, 0.00 )) -  SUM(iif (M.DH = 'H', M.u_IMP, 0.00 ))) <> 0 )
order by M.Periodo, M.Libro, M.Voucher


algo larguita la instruccion para algo tan sencillo..

se agradece
__________________
Dulce Regalo que Satanas manda para mi.....
Responder Con Cita