*!*
重问:字段加零问题
*!*
字符型字段加零问题
*!*
请教,在vf6.0版本里
*!*
我的表里有一个字段FH(字符型),是一组房号如:1-2-1-3
*!*
1-2-4-11
*!*
10-2-2-10
*!*
9-2-3-7
*!*
4-5-3-9
*!*
我想将此字段记录统一变为 :
01-2-1-03
*!*
01-2-4-11
*!*
10-2-2-10
*!*
09-2-3-07
*!*
04-5-3-09
*!*
上一个帖子里情况太单一,版主们给的命令我试后不大好使,不知道问题出在哪了
close all
create cursor tm (房号 C(12))
insert into tm values ('1-2-1-3')
insert into tm values ('1-2-4-11')
insert into tm values ('10-2-2-10')
insert into tm values ('9-2-3-7')
insert into tm values ('4-5-3-9')
replace all 房号 with;
padl(substr(房号,1,at('-',房号)-1),2,'0')+'-'+;
padl(substr(房号,at('-',房号)+1,at('-',房号,2)-at('-',房号)-1),2,'0')+'-'+;
padl(substr(房号,at('-',房号,2)+1,at('-',房号,3)-at('-',房号,2)-1),2,'0')+'-'+;
padl(substr(房号,at('-',房号,3)+1,at('-',房号-'-',4)-at('-',房号,3)-1),2,'0')
brow
return