Ver Mensaje Individual
  #1  
Antiguo 22-11-2021
luchifer luchifer is offline
No confirmado
 
Registrado: jul 2007
Ubicación: Santa Cruz - Bolivia
Posts: 50
Reputación: 0
luchifer Va por buen camino
Problemas Maestro/Detalle

Jovenes Buenos dias:


Estoy haciendo un reporte anualizado de cuentas bajo el formato MAESTRO DETALLE. Pretendo el mismo salga asi:
ene feb mar abr may jun ........ dic total
Activo
Bancos 520 600 650 700 800 900
ctas x 600 800 550 600 700 800
total 1120 1400 1200 1300 1500 1700

La instruccion para el Query del maestro es:

select idbal, cta, descri from lplancta where (idbal='2' or idbal='3' or idbal='7') and nivel='1'

Y la instruccion para el detalle es:

select distinct c.idbal, m.cta, c.descri,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=1 and year(i.fecha)=2021) as di1,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=2 and year(i.fecha)=2021) as di2,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=3 and year(i.fecha)=2021) as di3,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=4 and year(i.fecha)=2021) as di4,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=5 and year(i.fecha)=2021) as di5,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=6 and year(i.fecha)=2021) as di6,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=7 and year(i.fecha)=2021) as di7,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=8 and year(i.fecha)=2021) as di8,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=9 and year(i.fecha)=2021) as di9,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=10 and year(i.fecha)=2021) as di10,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=11 and year(i.fecha)=2021) as di11,
(select sum(i.debe-i.haber) from lcontmov i where i.cta=m.cta and month(i.fecha)=12 and year(i.fecha)=2021) as di12
from lcontmov m, lplancta c
where c.idbal=:idbal and m.cta=c.cta and year(m.fecha)=2021
order by m.cta

Y el momento de enlazar me da el erro objeto parameter mal definido.

ALGUIEN PODRIA POR FAVOR ORIENTARME Y DECIRME DONDE ME ESTOY EQUIVOCANDO
Responder Con Cita