我关心这样的统计有什么用途?
只求每天有一丁点儿的进步就可以了
CLOSE DATABASES CREATE CURSOR test (xm c(8), y1 n(2), y2 n(2), y3 n(2), y4 n(2), y5 n(2), y6 n(2), y7 n(2), y8 n(2), y9 n(2), y10 n(2), y11 n(2), y12 n(2)) USE C:\Users\Administrator\Desktop\bb\bb IN 0 SELECT bb SCAN lcStr = 'xm' lcXm = ALLTRIM(xm) FOR lnj = 2 TO FCOUNT() IF BETWEEN(EVALUATE(FIELD(lnj)), 1, 2) lcStr = lcStr + ", " + FIELD(lnj) ENDIF ENDFOR SELECT &lcStr FROM bb WHERE ALLTRIM(xm) == lcxm INTO CURSOR temp SELECT test APPEND FROM DBF("temp") ENDSCAN USE IN temp SELECT test BROWSE
ret = "Y1:Y2:Y3:Y4:Y5:Y6:Y7:Y8:Y9:Y10:Y11:Y12:" ret2 = ret SELECT *, SPACE(70) 低于3 FROM bb INTO CURSOR tmp READWRITE SCAN ret1 = ret FOR i=1 TO 12 cf = "Y"+TRANSFORM(i) ny = EVALUATE(cf) IF ny < 3 ret1 = STRTRAN(ret1, cf+":", ","+cf+":"+TRANSFORM(ny)) ELSE ret1 = STRTRAN(ret1, cf+":", "") IF AT(cf+":",ret2) > 0 ret2 = STRTRAN(ret2, cf+":", "") ENDIF ENDIF ENDFOR REPLACE 低于3 WITH SUBSTR(ret1,2) ENDSCAN INSERT INTO tmp (xm,低于3) VALUES ("所有人", TRIM(ret2,":")) SELECT * FROM tmp RETURN