USE ZZ
COPY TO BAK
USE BAK
ALTER TABLE BAK ADD LY C(1)
REPLACE LY WITH "A" ALL
APPEND FROM YY
REPLACE LY WITH "B" FOR EMPTY(LY)
SELECT * FROM BAK ORDER BY ZJH,DQRQ DESC,LY INTO DBF PXXXK
CLOSE DATABASES ALL
DELETE FILE BAK.DBF
USE PXXXK
GOTO TOP
T_SJ=DATETIME()
T_ZJH=""
SCAN IF T_ZJH=ZJH THEN IF ABS(T_SJ-DQRQ)/60<30 THEN DELETE ELSE T_SJ=DQRQ ENDIF ELSE T_SJ=DQRQ T_ZJH=ZJH ENDIF
ENDSCAN
PACK
SELECT * FROM PXXXK WHERE LY='B' INTO DBF BAK
USE ZZ