以下是引用reedwu在2012-3-17 12:42:21的发言:
因为前几天收盘就是最高价,所以数值都是100,不然的话,前30多条的记录都是错的,呵呵,不过也没关系,肯定不会用到那么前的数据
关键是最后的数据结果是否正确。
因为前几天收盘就是最高价,所以数值都是100,不然的话,前30多条的记录都是错的,呵呵,不过也没关系,肯定不会用到那么前的数据
坚守VFP最后的阵地
*----KD表 SELECT *,CAST("" AS Numeric(4)) AS TRME FROM 1A0001 WHERE trma>trmd INTO TABLE KD B=SHNO SCAN FOR RECNO()>1 AND !EOF() A=SHNO REPLACE TRME WITH A-B B=SHNO ENDSCAN DELETE FOR TRME=1 PACK BROWSE *----DK表 SELECT *,CAST("" AS Numeric(4)) AS TRME FROM 1A0001 WHERE trma<trmd INTO TABLE DK B=SHNO SCAN FOR RECNO()>1 AND !EOF() A=SHNO REPLACE TRME WITH A-B B=SHNO ENDSCAN DELETE FOR TRME=1 PACK BROWSE
*----生成新的数据表 SELECT *,CAST("" AS Numeric(4)) AS TRMEKD,CAST("" AS Numeric(4)) AS TRMEDK FROM 1A0001 INTO TABLE KDDK UPDATE KDDK SET TRMEKD=KD.TRME FROM KD WHERE KDDK.SHNO==KD.SHNO UPDATE KDDK SET TRMEDK=DK.TRME FROM DK WHERE KDDK.SHNO==DK.SHNO DELETE FOR (TRMEKD=0 AND TRMEDK=0) PACK BROWSE CLOSE TABLES ERASE KD.DBF ERASE DK.DBF ERASE KDDK.DBF