SET DATE TO YMD
d日期 = DATE()
n年 = YEAR(d日期)
n月 = MONTH(d日期)
c年月 = TRANSFORM(n年)+"/"+PADL(n月,2,"0")+"/"
n月天数 = DAY(GOMONTH(DATE(n年, 1, 31), n月 - 1))
cmd = "CREATE CURSOR tt (姓名 C(8)"
FOR i=1 TO n月天数
IF !INLIST(DOW(CTOD(c年月+TRANSFORM(i)),2),6,7) &&AND !节假日(i)
cmd = cmd + ",d"+PADL(i,2,"0")+" I"
ENDIF
ENDFOR
cmd = cmd + ")"
EXECSCRIPT(cmd)
APPEND FROM 旷工
? "连续旷工3日:"
SCAN
FOR i=2 TO FCOUNT()-2
IF EVALUATE(FIELD(i))!=0 AND EVALUATE(FIELD(i+1))!=0 AND EVALUATE(FIELD(i+2))!=0
? 姓名, FIELD(i),FIELD(i+1),FIELD(i+2)
ENDIF
ENDFOR
ENDSCAN
CLOSE DATABASES ALL
RETURN