No muestra datos
Hola experto buenas tardes tengo estos códigos que estuvieron funcionando muy bien con relación a otra tabla lo copie y modifique solo la tabla de movimiento y dos campos más pero solo muestra los resultados de la primera parte y a partir del sexo "F" no muestra información solo ceros y si tengo datos cuando hago las pruebas uno por uno recién muestra información no entiendo por que no lo hace bien si en el otro prg si esta funcionando correctamente, o quizás tengas otra forma de como poder ayudarme te lo agradecería mucho.
*************************************** CAPA SIMPLE Y PERFIL DE DIAGNOSTICOS
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalPeriodo0, ;
sum(iif(between(em_fecha,winiac,wfin),1,0)) as acumulado0,em_sexo,em_anos,pf_hospi ;
from analisis!cie, analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag ;
and between(emeeste.em_fecha,winiac,wfin) and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor este
**brow
select distin(pf_diag) as pro_codi, 0000000000 as total0, 0000000000 as acumu0, ;
0000000000 as xftotal0, 0000000000 as xmtotal0, ;
0000000000 as xtotal1, 0000000000 as xtotal14, ;
0000000000 as xtotal44, 0000000000 as xtotal64, ;
0000000000 as xtotal65 ;
from este into table C:\Informes\temp\emergencia\capa_compleja_perfil_dx_este
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele este
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xtotal0 = totalPeriodo0
xacumu0 = acumulado0
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(este.pf_hospi) = '3'
repla total0 with xtotal0
repla acumu0 with xacumu0
Endcase
se le este
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
************************************* FIN DE TOTALES Y ACUMULADOS DE CAPITULOS este************************************
*!* *!* ************************************* TOTALES DE SEXO FEMENINO************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as total0f, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag and em_sexo="F" and cie.capa="C" ;
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor feste
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele feste
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = total0f
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(feste.pf_hospi) = '3'
repla xftotal0 with xctotal0
Endcase
se le feste
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
*!* *!* ************************************* FIN DE TOTALES DEL SEXO FEMENINO************************************
*!* *!* ************************************* TOTALES DE SEXO MASCULINO************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as total0m, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag and em_sexo="M" and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor meste
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele meste
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = total0m
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(meste.pf_hospi) = '3'
repla xmtotal0 with xctotal0
Endcase
se le meste
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
*!* *!* ************************************* FIN DE TOTALES DEL SEXO MASCULINO************************************
************************************* TOTALES DE GRUPO ECTAREO < 1************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalg1, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag and em_anos<1 and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor geste
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele geste
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = totalg1
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(geste.pf_hospi) = '3'
repla xtotal1 with xctotal0
Endcase
se le geste
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
************************************* FIN DE TOTALES GRUPO ETAREO < 1************************************
************************************* TOTALES DE GRUPO ECTAREO 1 - 14 ************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalg14, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag and em_anos between 1 and 14 and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor geste14
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele geste14
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = totalg14
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(geste14.pf_hospi) = '3'
repla xtotal14 with xctotal0
Endcase
se le geste14
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
************************************* FIN DE TOTALES GRUPO ETAREO 01-14************************************
************************************* TOTALES DE GRUPO ECTAREO 15 - 44 ************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalg44, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag ;
and em_anos between 15 and 44 and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor geste44
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele geste44
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = totalg44
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(geste44.pf_hospi) = '3'
repla xtotal44 with xctotal0
Endcase
se le geste44
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
************************************* FIN DE TOTALES GRUPO ETAREO 15-44************************************
************************************* TOTALES DE GRUPO ECTAREO 45 - 64 ************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalg64, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where...
*************************************** CAPA SIMPLE Y PERFIL DE DIAGNOSTICOS
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalPeriodo0, ;
sum(iif(between(em_fecha,winiac,wfin),1,0)) as acumulado0,em_sexo,em_anos,pf_hospi ;
from analisis!cie, analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag ;
and between(emeeste.em_fecha,winiac,wfin) and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor este
**brow
select distin(pf_diag) as pro_codi, 0000000000 as total0, 0000000000 as acumu0, ;
0000000000 as xftotal0, 0000000000 as xmtotal0, ;
0000000000 as xtotal1, 0000000000 as xtotal14, ;
0000000000 as xtotal44, 0000000000 as xtotal64, ;
0000000000 as xtotal65 ;
from este into table C:\Informes\temp\emergencia\capa_compleja_perfil_dx_este
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele este
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xtotal0 = totalPeriodo0
xacumu0 = acumulado0
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(este.pf_hospi) = '3'
repla total0 with xtotal0
repla acumu0 with xacumu0
Endcase
se le este
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
************************************* FIN DE TOTALES Y ACUMULADOS DE CAPITULOS este************************************
*!* *!* ************************************* TOTALES DE SEXO FEMENINO************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as total0f, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag and em_sexo="F" and cie.capa="C" ;
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor feste
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele feste
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = total0f
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(feste.pf_hospi) = '3'
repla xftotal0 with xctotal0
Endcase
se le feste
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
*!* *!* ************************************* FIN DE TOTALES DEL SEXO FEMENINO************************************
*!* *!* ************************************* TOTALES DE SEXO MASCULINO************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as total0m, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag and em_sexo="M" and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor meste
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele meste
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = total0m
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(meste.pf_hospi) = '3'
repla xmtotal0 with xctotal0
Endcase
se le meste
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
*!* *!* ************************************* FIN DE TOTALES DEL SEXO MASCULINO************************************
************************************* TOTALES DE GRUPO ECTAREO < 1************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalg1, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag and em_anos<1 and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor geste
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele geste
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = totalg1
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(geste.pf_hospi) = '3'
repla xtotal1 with xctotal0
Endcase
se le geste
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
************************************* FIN DE TOTALES GRUPO ETAREO < 1************************************
************************************* TOTALES DE GRUPO ECTAREO 1 - 14 ************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalg14, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag and em_anos between 1 and 14 and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor geste14
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele geste14
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = totalg14
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(geste14.pf_hospi) = '3'
repla xtotal14 with xctotal0
Endcase
se le geste14
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
************************************* FIN DE TOTALES GRUPO ETAREO 01-14************************************
************************************* TOTALES DE GRUPO ECTAREO 15 - 44 ************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalg44, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where cie.pf_diag = emeeste.pf_diag ;
and em_anos between 15 and 44 and cie.capa="C";
group by emeeste.pf_diag;
order by emeeste.pf_diag;
into cursor geste44
**brow
sele capa_compleja_perfil_dx_este
go top
scan
xprograma = allt(pro_codi)
sele geste44
do while allt(pf_diag) = xprograma
do case
case alltrim(pf_hospi) = '3'
xhospi = '3'
xctotal0 = totalg44
endcase
sele capa_compleja_perfil_dx_este
do case
case alltrim(geste44.pf_hospi) = '3'
repla xtotal44 with xctotal0
Endcase
se le geste44
skip
endd
sele capa_compleja_perfil_dx_este
ends
**brow
************************************* FIN DE TOTALES GRUPO ETAREO 15-44************************************
************************************* TOTALES DE GRUPO ECTAREO 45 - 64 ************************************
select emeeste.pf_diag, cie.descri, sum(iif(between(em_fecha,wini,wfin),1,0)) as totalg64, ;
em_sexo,em_anos,pf_hospi ;
from analisis!cie,analisis!emeeste ;
where...
1 Respuesta
Respuesta de davsoft
1