从列中取出所有值并将它们放在一起并加上“; "分隔器 [英] Taking all values from a column and putting them together with a "; " separator

查看:82
本文介绍了从列中取出所有值并将它们放在一起并加上“; "分隔器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当时看起来很简单...


询问他们的电子邮件地址,然后当我有一个联系人列表时,我可以让我的Access数据库吐出地址对我来说......


这是'我的quandry:

我有一个表(与我数据库中的其他表相关),只列出[名称] [EmailAddress]和[ContactNumber]。我使用一些查询对所有内容进行排序,最终通常会列出大约5-10个人,需要一封电子邮件来提醒他们拖欠条目。我有一个Outlook模板,所有组成并准备就绪 - 我想我可以很容易地抓住电子邮件地址(以前从未尝试过这个 - 但是嘿 - 访问应该让这部分变得简单,对吧?)


在得知这里似乎没有内置函数之后,我想也许我应该尝试将这些地址发送到我的表单中的文本框(隐藏在视图中)并只使用vba来插入该值进入To:line ...

经过很多挫折之后,我感到难过。我知道它可能很简单 - 但对于我的生活,我无法弄清楚这一点!我读到的所有主题都是关于如何在vba中构建电子邮件(我已经可以做)或如何在一行中连接不同的值......


我需要(我认为能够将我的查询中的一个COLUMN的值连接到一个文本框中,我可以从那里继续它。


(我的SQL和VBA技能都是业余的,所以如果您有时间回复,请向我解释,就像我10岁!)


提前感谢您的帮助!


Dave

It seemed simple at the time...

Ask for their email addresses, then when I have a list of people to contact, I can make my Access database spit the addresses out for me...

Here''s my quandry:
I have a table (related to other tables in my database)that simply lists [Name][EmailAddress] and [ContactNumber]. I use a few queries to sort everything out and end up with usually about 5-10 people listed that need an email to remind them of delinquent entries. I have an Outlook template all made up and ready - and I figured I could grab the email addresses pretty easily (never tried this before - but hey - Access should make this part easy, right?)

After learning that there doesn''t seem to be a built in function for this, I figured maybe I should try to send these addresses to a textbox in my form (hidden from view) and just use vba to plug that value into the To: line...

After a LOT of frustration, I am stumped. I know it''s probably something simple - but for the life of me, I cannot figure this out! All of the threads I read are either for how to build an email in vba (which I already can do) or how to concatenate different values on a row...

I need (I think) to be able to concatenate the values from one COLUMN in my query into a textbox, and I can carry it from there.

(My SQL and VBA skills are amateur, so if you have the time to respond, please explain it to me like I''m a 10 year old!)

Thanks in advance for your help!

Dave

推荐答案

所以基本上你必须运行一些VBA才能让它工作,但它不应该那么难。 br />


首先,您必须打开记录集才能收到所有电子邮件。然后你将不得不遍历记录集。

So basically you are going to have to run some VBA to get this to work, but it shouldn''t be that hard.


First you are going to have to open a recordset to get all the emails. Then you are going to have to loop through the recordset.

展开 | 选择 | Wrap | 行号


t-sql是否可以访问?虽然我已经看过,但是我不知道如何重复,我已经看到这是通过精心使用合并和东西完成的。
Does t-sql work in access? I''v seen this done with an elaborate use of coalesce and stuff, though I''ve seen, I could not tell how to repeat.


对问题感兴趣。在代码中相当容易,但不能通过PIVOT或TRANSFORM完成吗?我不知道怎么做,但看起来应该是可能的。
Interested in the question. Fairly easy to do in code but can it not be done via PIVOT or TRANSFORM? I can''t work out how, but it seems like it should be possible.


这篇关于从列中取出所有值并将它们放在一起并加上“; "分隔器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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