如何将文本字段中具有各种长度的最后一个字符替换为另一个字符 [英] How do I replace the last character in a text field that have various lenghts with another character

查看:57
本文介绍了如何将文本字段中具有各种长度的最后一个字符替换为另一个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含AMT字段的表格,其中包含各种数字字符和六个字母结尾 在0到9之间的数字范围内。 我需要用等效的字母替换那些最后的字符,例如0 =!,1 = J,2 = K,
3 = L,4 = M,5 = N,6 = O,7 = P,8 = Q,AND 9 = R. 我需要用字母字符替换这些数字,任何人都可以帮助使用VBA或更新查询吗?

解决方案

您可以创建基于的更新查询表格。


将AMT字段添加到查询网格。


在更新到:行中,输入


左([AMT],Len([AMT]) - 1)& CHR(右([AMT],1)73)


I have a table that has a AMT field that contains various numeric characters and sixes ending  in a range of numbers from 0 to 9.  I need to replace those last characters with their letter equivalent for example 0=!, 1=J, 2=K, 3=L, 4=M, 5=N, 6=O, 7=P, 8=Q, AND 9=R.  I need to replace these numbers with the letter characters, can anybody help using either VBA or an Update Query?

解决方案

You can create an Update query based on the table.

Add the AMT field to the query grid.

In the Update to: line, enter

Left([AMT],Len([AMT])-1) & Chr(Right([AMT],1)+73)


这篇关于如何将文本字段中具有各种长度的最后一个字符替换为另一个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆