如何将1个字段中的数据内容分成2个字段 [英] How to split content of data in 1 field into 2 fields

查看:134
本文介绍了如何将1个字段中的数据内容分成2个字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在访问sql中运行查询或使用查询向导将字段数据拆分为2.

该字段包含1234 ave willie等数据并且有电子邮件地址sucha haha​​ @ yahoo我需要在一个新的字段名称St地址和haha@yahoo.com中创建put 1234 ave willie在电子邮件领域。可以提供一些帮助吗?

应该像通配符一样运营商等?

解决方案

您可以在中心位置放置百分号作为分隔符。然后,您将使用Left()和InStr()函数的组合来获取左侧以及Mid()和InStr()函数的组合以获得右侧。例如,假设您的字段名为组合

展开 | 选择 | Wrap | 行号


Seth:

这更像是一个要么是家庭作业问题,要么是从平面文本文件转换到kr85'圈中的转换


此外,在某些情况下,您的解决方案可能是可行的;然而,kr85确实没有提供足够的信息来可靠地解析蜇伤。

kr85:
有关详细信息,请参阅常见问题解答和特定论坛粘性线程。

>>发布前(VBA或SQL)代码
>>如何问好问题 - 在提交问题之前阅读!
>> POSTING_GUIDELINES:请在发布论坛之前仔细阅读


现在您已经阅读了这些内容,我相信您会理解:

>正确的完整代码请求是针对网站政策的。

>字节不是代码也不是家庭作业服务。如果您仍然不明白这一点,请重新阅读常见问题解答和发布指南。

>尊敬地,您的主题可能会被移除,因为要求某人提供完整的代码或完成的项目是违反网站政策的 - 除非您能够展示您已经尝试过的内容。


[Z {编辑 - 原帖#4}]

谢谢seth ..

我们非常接近...

再次解释..

我有一个名为contact的字段,它有电子邮件地址或街道广告。

当我运行我的查询时,我需要告诉它将所有电子邮件地址放在另一个称为电子邮件的字段中所有街道地址都在另一个字段名称地址。

所以联系人字段有电子邮件或街头地址吗?


[z {编辑 - 原帖# 5}]


我认为它应该像@并且还使用了instr?但是我无法弄清楚..


[Z {Origninal Post#6}]

展开 | 选择 | Wrap | 行号

I have to run a query in access sql or using query wizard to split the data of field into 2.
The field has data such as 1234 ave willie and has email adresses sucha haha@yahoo.com .I need to create put 1234 ave willie in a new field name St address and haha@yahoo.com in email field.Can some help?
should as wildcard such as like operator etc?

解决方案

You could put a percent sign where you want the break as the delimiter. You would then use a combination of the Left() and InStr() functions to get the left side and a combination of the Mid() and InStr() functions to get the right side. For example, lets say your field is named Combination.

Expand|Select|Wrap|Line Numbers


Seth:
this is more like a either a homework question or a conversion from a flat text file that has been dumped in kr85''s lap

Also, your solution may be viable in some cases; however, kr85 really hasn''t provided enough information to reliably parse the stings.


kr85:
Please consult the FAQ and specific forum sticky threads for further information.

>> Before Posting (VBA or SQL) Code.
>> How to ask "good" questions -- READ BEFORE SUBMITTING A QUESTION!.
>> POSTING_GUIDELINES: Please Read Carefully Before Posting to a Forum.

Now that you read these, I''m sure that you''ll understand:
> Out right requests for full code are against site policy.
> Bytes is not a code nor homework service. If you still don''t understand this then please re-read the FAQ and posting guidelines.
> Respectfully, your thread may be removed because asking for someone to provide completed code or a completed project is against site policy - unless you can show what you''ve already tried.


[Z{Edit - Original Post #4}]
Thanks seth..
We are very close...
again il explain..
I have a field called contact it has either email adress or street adreeses.
When i run my query i need to tell it put all email address in 1 other field called email and all the street address in another field name address.
So the contact field has either an email or street addrees?

[z{Edit - Original Post #5}]

im thinking it should have like "@" and also using instr?but i cant figure it out..

[Z{Origninal Post #6}]

Expand|Select|Wrap|Line Numbers


这篇关于如何将1个字段中的数据内容分成2个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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