#2
Heris_Lau2023-10-16 17:21
|
程序代码:
SELECT DISTINCT YM FROM temp INTO CURSOR YM
DECLARE A(reccount(),fcount())
DECLARE B(reccount(),fcount())
sele YM
INDEX on YM to aa
COPY TO ARRAY A
FOR i=1 TO RECCOUNT()*FCOUNT()
B(i)='Q'+A(i)
ENDFOR
DISPLAY MEMORY LIKE A*
DISPLAY MEMORY LIKE B*
SELECT DISTINCT bjh, dpt FROM temp GROUP BY bjh,dpt INTO CURSOR zidiso_0
k=0
FOR j=1 TO 1
X=('zidiso_0_a'+ALLTRIM(str(j,1)))
SELECT DISTINCT bjh, dpt,qty FROM temp WHERE YM==A(j) INTO CURSOR &x
y=('zidiso_'+STR(k,1))
SELECT (&y).*,(&x).qty as (B(j)) FROM (&y) LEFT JOIN (&x) ON (&y).BJH=(&x).bjh AND (&y).dpt=(&x).dpt INTO CURSOR ('zidiso_'+STR((k+1),1)) &&错误行,错在哪儿了
k=k+1
ENDFOR
COPY TO zidiso_6
DECLARE A(reccount(),fcount())
DECLARE B(reccount(),fcount())
sele YM
INDEX on YM to aa
COPY TO ARRAY A
FOR i=1 TO RECCOUNT()*FCOUNT()
B(i)='Q'+A(i)
ENDFOR
DISPLAY MEMORY LIKE A*
DISPLAY MEMORY LIKE B*
SELECT DISTINCT bjh, dpt FROM temp GROUP BY bjh,dpt INTO CURSOR zidiso_0
k=0
FOR j=1 TO 1
X=('zidiso_0_a'+ALLTRIM(str(j,1)))
SELECT DISTINCT bjh, dpt,qty FROM temp WHERE YM==A(j) INTO CURSOR &x
y=('zidiso_'+STR(k,1))
SELECT (&y).*,(&x).qty as (B(j)) FROM (&y) LEFT JOIN (&x) ON (&y).BJH=(&x).bjh AND (&y).dpt=(&x).dpt INTO CURSOR ('zidiso_'+STR((k+1),1)) &&错误行,错在哪儿了
k=k+1
ENDFOR
COPY TO zidiso_6
[此贴子已经被作者于2023-10-16 17:26编辑过]