* 运行环境:WINXP+VFP9
CLOSE DATABASES ALL
USE jbxx IN 0
SELECT jbxx
SCAN NEXT 1 && 此处为测试用
SELECT xm, zxsj FROM gz_201410 where xm == jbxx.xm ;
UNION ALL SELECT xm, zxsj FROM gz_201501 where xm == jbxx.xm ;
UNION ALL SELECT xm, zxsj FROM gz_201601 where xm == jbxx.xm ;
UNION ALL SELECT xm, zxsj FROM gz_201605 where xm == jbxx.xm ;
UNION ALL SELECT xm, zxsj FROM gz_201607 where xm == jbxx.xm ;
UNION ALL SELECT xm, zxsj FROM gz_201701 where xm == jbxx.xm ;
UNION ALL SELECT xm, zxsj FROM gz_201709 where xm == jbxx.xm ;
UNION ALL SELECT xm, zxsj FROM gz_201801 where xm == jbxx.xm ;
INTO CURSOR tt
ENDSCAN
临时表 tt 即为报表的数据源,就不用考虑某个人某年的数据不存在的问题。