标题:字符型字段加零问题
只看楼主
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
得分:0 
以下是引用Tiger5392在2010-8-28 10:04:45的发言:

replace all 房号 with padl(        substr(房号, 1,              at('-',房号)-1             ), 2, '0')+'-'+;
                      padl(        substr(房号, at('-',房号)+1, at('-',房号,2)-at('-',房号)), 2, '0')+'-'+;
                      padl(alltrim(substr(房号, at('-',房号,2)+1                           )),2, '0')
replace all 房号 with padl(        substr(房号, 1,              at('-',房号)-1             ), 2, '0')+'-'+;
                      padl(        substr(房号, at('-',房号)+1, at('-',房号,2)-at('-',房号)-1), 2, '0')+'-'+;
                      padl(alltrim(substr(房号, at('-',房号,2)+1                           )),2, '0')

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2010-08-30 21:31
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:323
帖 子:9621
专家分:26174
注 册:2012-2-5
得分:0 
REPLACE ALL FH WITH LEFT(a,4)+PADL(ALLTRIM(SUBSTR(a,5)),2,[0])

坚守VFP最后的阵地
2014-03-25 12:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-316947-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.089878 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved