取值条件:
工号= MZGHYYDJ.DJRY
姓名= MZGHYYDJ.DJRYXM
总预约数量=MZGHYYDJ 的记录数
有效预约数量=MZGHYYDJ.ZFRY IS NULL 的记录数
已取号数量= MZGHYYDJ.ZFRY IS NULL AND MZGHYYDJ.MZH IS NOT NUL
代码:
For ll_i = 1 to ids_fdmcb.rowcount( )
ls_userbz = ids_fdmcb.object.userbz[ll_i] + '.'
ls_sql = " SELECT A.DJRY,A.DJRYXM,isnull(A.ZFRY,''), isnull(A.MZH,'')"
ls_sql += " FROM "+ls_userbz+"MZGHYYDJ A "
ls_sql += " GROUP BY A.DJRY ,A.DJRYXM"
DECLARE c1 DYNAMIC CURSOR FOR SQLSA;
PREPARE SQLSA FROM :ls_sql;
OPEN DYNAMIC c1 USING :lde_minno,:lde_maxno;
do while true
fetch c1 into :ls_djry,:ls_djryxm,:lde_zfry,:lde_mzh ;
if sqlca.sqlcode<>0 then
exit;
end if
ll_row = dw_1.find(" djry ='"+ls_djry+"' ",1, dw_1.rowcount( ) )
ll_row1 = dw_1.find(" djry ='"+ls_djry+"' AND zfry='' ",1, dw_1.rowcount( ) )
ll_row2 = dw_1.find(" djry ='"+ls_djry+"' AND zfry='' AND mzh<>'' ",1, dw_1.rowcount( ) )
If ll_row <= 0 then
ll_row = dw_1.insertrow(0)
dw_1.object.djry[ll_row] = ls_djry
dw_1.object.djryxm[ll_row] = ls_djryxm
End If
dw_1.object.zyy[ll_row] = dw_1.object.zyy[ll_row] + 1
dw_1.object.yxyy[ll_row1] = dw_1.object.yxyy[ll_row1] + 1
dw_1.object.yqh[ll_row2] = dw_1.object.yqh[ll_row2] + 1
loop;
close c1;
Next
------解决方案--------------------
太混乱了.
------解决方案--------------------
没看明白