以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- [求助]修改字段 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=190317)
|
-- 作者:江南小镇
-- 发布时间:2024/1/31 11:31:00
-- [求助]修改字段
老师,我想把M1,M2修改成一月,二月........谢谢老师
Tables("水电气使用数据查询_Table1").Fill("Select * Fr om {水电气统计}","能源消耗数据查询",True) Tables("水电气使用数据查询_Table1").SetColVisibleWidth("编号|38|年|38|项目|34|项目ID|118|M1|49|M2|29|M3|63|M4|34|M5|41|M6|49|M7|49|M8|49|M9|41|M10|41|M11|41|M12|49|年度统计|70")
|
-- 作者:有点蓝
-- 发布时间:2024/1/31 11:50:00
--
dim s1() as string = {"M1","M2",........}dim s2() as string = {"一月","二月",........} dim s as string = "编号|38|年|38|项目......." for i as integer = 0 to s1.length - 1 s = s.replace(s1(i),s2(i)) next msgbox(s)
|
-- 作者:江南小镇
-- 发布时间:2024/1/31 17:13:00
--
老师,哪里不对。
Tables("水电气使用数据查询_Table1").Fill("Select * Fr om {水电气统计}","房屋出租能源消耗数据查询",True) ID|118|M1|49|M2|29|M3|63|M4|34|M5|41|M6|49|M7|49|M8|49|M9|41|M10|41|M11|41|M12|49|年度统计|70")
Dim s1() As String = {"M1","M2","M2","M3","M4","M5","M6","M7","M8","M9","M10","M11","M12"} Dim s2() As String = {"一月","二月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"} Dim s As String = "编号|38|年|38|项目|34|项目ID|118|一月|50|二月|50|三月|50|四月|50|五月|50|六月|50|七月|50|八月|50|九月|50|十月|50|十一月|50|十二月|50" For i As Integer = 0 To s1.length - 1 s = s.replace(s1(i),s2(i)) Next msgbox(s)
|
-- 作者:有点蓝
-- 发布时间:2024/1/31 17:15:00
--
Dim s As String = "编号|38|年|38|项目|34|项目ID|118|M1|50|M2|5............
|
-- 作者:江南小镇
-- 发布时间:2024/1/31 17:38:00
--
老师,还是不行。
Dim s1() As String = {"M1","M2","M2","M3","M4","M5","M6","M7","M8","M9","M10","M11","M12"} Dim s2() As String = {"一月","二月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"} Dim s As String = "编号|38|年|38|项目|34|项目ID|118|M1|50|M2|50|M3|50|M4|50|M5|50|M6|50|M7|50|M8|50|M9|50|M10|50|M11|50|M12|50" For i As Integer = 0 To s1.length - 1 s = s.replace(s1(i),s2(i)) Next msgbox(s)
|
-- 作者:有点蓝
-- 发布时间:2024/2/1 8:29:00
--
什么地方不行?我测试没有问题
|
-- 作者:江南小镇
-- 发布时间:2024/2/1 10:16:00
--
老师好
此主题相关图片如下:屏幕截图 2024-02-01 101507.jpg
[此贴子已经被作者于2024/2/1 10:19:49编辑过]
|
-- 作者:有点蓝
-- 发布时间:2024/2/1 10:24:00
--
不就已经替换了吗,有啥问题?
|
-- 作者:cd_tdh
-- 发布时间:2024/2/1 10:35:00
--
后面三个月“10、11、12月”不对
For i As Integer = 1 To s1.length - 1
[此贴子已经被作者于2024/2/1 10:37:47编辑过]
|
-- 作者:江南小镇
-- 发布时间:2024/2/1 10:37:00
--
找不出原因
|