回复 10楼 gs2536785678
您是VFP的高手啊!下面这个链接是我发在ACCESS区的,请移步看一下,刚摸索了几天ACCESS,还没找到解决方法,不知VFP能实现吗?https://bbs.bccn.net/thread-507280-1-1.html
CLOSE TABLES all SET SAFETY OFF SELECT distinct 班级,标签,考生号,姓名 FROM cjzb INTO CURSOR cjtmp WHERE .f. READWRITE ALTER table cjtmp ADD km c(6) ALTER table cjtmp ADD kmcj n(4,1) ALTER table cjtmp ADD mc i SELECT distinc 班级,考生号 FROM cjzb INTO CURSOR xstmp ORDER BY 班级,考生号 SCAN cksh=ALLTRIM(考生号) FOR i=0 TO 5 SELECT 班级,标签,考生号,姓名,FIELD(2*i+4) km, EVALUATE(FIELD(2*i+4)) kmcj,EVALUATE(FIELD(2*i+5)) mc FROM cjzb INTO dbf ls WHERE ALLTRIM(考生号)==cksh AND EVALUATE(FIELD(2*i+4))>0 IF _tally=0 LOOP ENDIF SELECT cjtmp APPEND FROM ls ENDFOR ENDSCAN SELECT DISTINCT 班级,km FROM cjtmp INTO CURSOR mpmp SELECT 班级,标签,考生号,姓名,km 科目1,kmcj 成绩1,mc 名次1 FROM cjtmp INTO CURSOR cj1tmp WHERE MOD(RECNO(),3)=1 SELECT 考生号 ksh1,km 科目2,kmcj 成绩2,mc 名次2 FROM cjtmp INTO CURSOR cj2tmp WHERE MOD(RECNO(),3)=2 SELECT 考生号 ksh2,km 科目3,kmcj 成绩3,mc 名次3 FROM cjtmp INTO CURSOR cj3tmp WHERE MOD(RECNO(),3)=0 SELECT cj1tmp.*,科目2,成绩2,名次2,科目3,成绩3,名次3 FROM cj1tmp JOIN cj2tmp ON 考生号=ksh1 JOIN cj3tmp ON ksh1=ksh2 INTO CURSOR dccjtmp COPY TO cj xl5
[此贴子已经被作者于2021-10-25 22:38编辑过]
[此贴子已经被作者于2021-10-26 04:15编辑过]