查未用的手編號表
来源:互联网 发布:采购一般用哪些软件 编辑:程序博客网 时间:2024/06/04 23:30
LPARA nTempConnect,nTempTableName,nTempTableName1,nTempWhere&&此句必須請不要刪除(<連接句柄>,<主表表名>,<返回的臨時表名>,<查詢的條件>)
IF SQLEXEC(nTempConnect,"SELECT zzordref ordref FROM "+nTempTableName+" where len(zzordref)>0 "+iif(empty(nTempWhere),""," and "+nTempWhere)+" group by zzordref order by zzordref","aa")<=0
RETU
ENDIF
*!* 數字開頭的﹕
crea cursor numtab(ordref c(20))
sele val(ordref) ordref from aa where ordref>"0" and ordref<"9" INTO CURSOR bb
sele bb
calculate max(ordref) to maxref
go 1
FOR I=11355 to maxref
LOCATE FOR ordref=I
IF !FOUND()
sele numtab
insert into numtab values (str(I))
ENDIF
sele bb
go top
ENDFOR
*!* 字符開頭的﹕
dime cname(7)
cname(1)="'RP'"
cname(2)="'SRP'"
cname(3)="'FP'"
cname(4)="'PH'"
cname(5)="'LF'"
cname(6)="'FRP'"
cname(7)="'CRP'"
dime minref(7)
minref(1)=1688
minref(2)=249
minref(3)=8043
minref(4)=103
minref(5)=261
minref(6)=154
minref(7)=2684
FOR K=1 TO 7
sele nupart(ordref) ordref from aa where ordref like &cname(K)+'%' INTO CURSOR CC
IF _TALLY>0
sele cc
calculate max(ordref) to maxref
go 1
FOR J=minref(k) to maxref
LOCATE FOR ordref=J
IF !FOUND()
sele numtab
insert into numtab values (&cname(K)+alltrim(str(J)))
ENDIF
sele cc
go top
ENDFOR
ENDIF
ENDF
sele alltrim(ordref) ordref from numtab INTO CURSOR (nTempTableName1) order by ordref
*********************************************************************
* 功 能: 得出一個字符串后面的數字 *
* 用 法: NUPART(<數字>) *
* 返 回 值: 字符串后面的數字 *
*********************************************************************
FUNC NUPART
LPARA AA
LOCAL I,BB
BB=0
FOR I=1 TO LEN(AA)
IF ISDI(SUBS(AA,I,1))
BB=VAL(SUBSTR(AA,I))
I=LEN(AA)+1
ENDIF
ENDFOR
RETU BB
ENDFUNC
IF SQLEXEC(nTempConnect,"SELECT zzordref ordref FROM "+nTempTableName+" where len(zzordref)>0 "+iif(empty(nTempWhere),""," and "+nTempWhere)+" group by zzordref order by zzordref","aa")<=0
RETU
ENDIF
*!* 數字開頭的﹕
crea cursor numtab(ordref c(20))
sele val(ordref) ordref from aa where ordref>"0" and ordref<"9" INTO CURSOR bb
sele bb
calculate max(ordref) to maxref
go 1
FOR I=11355 to maxref
LOCATE FOR ordref=I
IF !FOUND()
sele numtab
insert into numtab values (str(I))
ENDIF
sele bb
go top
ENDFOR
*!* 字符開頭的﹕
dime cname(7)
cname(1)="'RP'"
cname(2)="'SRP'"
cname(3)="'FP'"
cname(4)="'PH'"
cname(5)="'LF'"
cname(6)="'FRP'"
cname(7)="'CRP'"
dime minref(7)
minref(1)=1688
minref(2)=249
minref(3)=8043
minref(4)=103
minref(5)=261
minref(6)=154
minref(7)=2684
FOR K=1 TO 7
sele nupart(ordref) ordref from aa where ordref like &cname(K)+'%' INTO CURSOR CC
IF _TALLY>0
sele cc
calculate max(ordref) to maxref
go 1
FOR J=minref(k) to maxref
LOCATE FOR ordref=J
IF !FOUND()
sele numtab
insert into numtab values (&cname(K)+alltrim(str(J)))
ENDIF
sele cc
go top
ENDFOR
ENDIF
ENDF
sele alltrim(ordref) ordref from numtab INTO CURSOR (nTempTableName1) order by ordref
*********************************************************************
* 功 能: 得出一個字符串后面的數字 *
* 用 法: NUPART(<數字>) *
* 返 回 值: 字符串后面的數字 *
*********************************************************************
FUNC NUPART
LPARA AA
LOCAL I,BB
BB=0
FOR I=1 TO LEN(AA)
IF ISDI(SUBS(AA,I,1))
BB=VAL(SUBSTR(AA,I))
I=LEN(AA)+1
ENDIF
ENDFOR
RETU BB
ENDFUNC
- 查未用的手編號表
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 的
- 12天完成切换至标准化web重构 --第四天 调用样式表
- 返回一個表中的記錄總數
- 開單統計表
- 12天完成切换至标准化web重构 --第五天 head区的其他设置
- SELECT 語句二條
- 查未用的手編號表
- MT summit X 感想之感想
- (转贴)利用XMLHTTP无刷新添加数据之Post篇.
- 表單根據文本框中輸入的內容自動更改
- 2005年9月24日(网站被入侵了)
- 使用 Osql 工具管理 SQL Server 桌面引擎 (MSDE 2000)
- 论坛的链接平台.......
- 神州泰岳测试试题(笔试)
- 中软面试题