使用LEFT选择整个单词(最左边的单词) [英] using LEFT to select a whole word (the left-most one)

查看:134
本文介绍了使用LEFT选择整个单词(最左边的单词)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用名称字段,其中包含

中的整个名称。报表中的一个字段实际上是一个字母。在

课程的信件中,我需要在问候语

行中用名字来说明收件人。我可以创建一个声明只使用最左边的单词

说明有多少个字符?


很多,非常感谢!


mike

I am trying to use this with a name field that has the entire name in
one field in a report that is actually a letter. In the letter, of
course, I need to address the recipient by first name in the greeting
line. Can I create a statement to use only the left-most word instead
of stating how many characters?

Many, many thanks!

mike

推荐答案




Left(PersonsWholeName,Instr (PersonsWholeName,""))

搜索第一个空格

Phil


" magmike" ; < ma ****** @ yahoo.com在留言中写道

新闻:11 ********************** @ g4g2000hsf .googlegro ups.com ...


Left(PersonsWholeName ,Instr(PersonsWholeName," "))
Searches for the first space

Phil

"magmike" <ma******@yahoo.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...

>我正在尝试将此名称字段用于

中的全名报告中的一个字段实际上是一个字母。在

课程的信件中,我需要在问候语

行中用名字来说明收件人。我可以创建一个声明只使用最左边的单词

说明有多少个字符?


很多,非常感谢!


mike
>I am trying to use this with a name field that has the entire name in
one field in a report that is actually a letter. In the letter, of
course, I need to address the recipient by first name in the greeting
line. Can I create a statement to use only the left-most word instead
of stating how many characters?

Many, many thanks!

mike



magmike< ma ****** @ yahoo.comwrote in news:1191877329.697545。 220570

@ g4g2000hsf.googlegroups.com:
magmike <ma******@yahoo.comwrote in news:1191877329.697545.220570
@g4g2000hsf.googlegroups.com:

我正在尝试使用名称字段,其中包含整个名称

报告中的一个字段实际上是一个字母。在

课程的信件中,我需要在问候语

行中用名字来说明收件人。我可以创建一个声明只使用最左边的单词

说明有多少个字符?


很多,非常感谢!


mike
I am trying to use this with a name field that has the entire name in
one field in a report that is actually a letter. In the letter, of
course, I need to address the recipient by first name in the greeting
line. Can I create a statement to use only the left-most word instead
of stating how many characters?

Many, many thanks!

mike



使用instr()函数查找第一个空格,减去1,测试

为负数值并将其传递给left()函数


FirstName:left(Fullname,abs(instr(Fullname,"") - 1))

-

Bob Quintal


PA是我改变了我的电子邮件地址。


-

通过 http://中的免费Usenet帐户发布www.teranews.com

Use the instr() function to find the first space, subtract 1, test for
negative value and pass this to the left() function

FirstName: left(Fullname,abs(instr(Fullname," ")-1))

--
Bob Quintal

PA is y I''ve altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com


10月8日下午4:02,magmike< magmi ... @ yahoo.comwrote:
On Oct 8, 4:02 pm, magmike <magmi...@yahoo.comwrote:

我正在尝试使用名称字段,其中包含

中的整个名称。报表中的一个字段实际上是一个字母。在

课程的信件中,我需要在问候语

行中用名字来说明收件人。我可以创建一个声明只使用最左边的单词

说明有多少个字符?


很多,非常感谢!


迈克
I am trying to use this with a name field that has the entire name in
one field in a report that is actually a letter. In the letter, of
course, I need to address the recipient by first name in the greeting
line. Can I create a statement to use only the left-most word instead
of stating how many characters?

Many, many thanks!

mike



假设名字总是最后一个,并且它与空格分开

,并且它永远不会有任何尾随空格,然后

使用instrRev()来定位最后一个空格。你的名字将在下一个位置开始



sFirstName = mid(instrRev(" Smith,John","")+ 1)

Assuming that the first name is always last, and that it is separated
with a space, and that it will never have any trailing spaces, then
use instrRev( ) to locate the last space. Your first name will start
in the next position.
sFirstName=mid(instrRev("Smith, John"," ")+1)


这篇关于使用LEFT选择整个单词(最左边的单词)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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