Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 MS-Access 中,我有一个标记为 idStr 的文本字段,目前,数据显示如下“000000000”。我想通过编写更新查询来转换字符串并使其如下所示:“000-00-0000”。换句话说,我想在第三个字符和第五个字符之后插入 - (连字符)。
我见过的唯一解决方案是使用左右编写一个选择查询,但我实际上是在尝试更新字符串并使其永久化
如果要更改字符串,可以将逻辑放在update语句中:
update
update t set idstr = left(idstr, 3) & "-" & mid(idstr, 4, 2) & "-" & right(idstr, 4);