组合行 - 排序顺序 [英] Combining Rows - Sort Order

查看:80
本文介绍了组合行 - 排序顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实施了这个解决方案,并发现只有具有相同CompanyName的记录才有效。在桌子旁边彼此相邻。更具体地说,VBA代码根据表中主键的顺序处理每个记录。如果表中的记录不相邻,有没有办法实现原始海报的目标?


感谢您的帮助!

I''ve implemented this solution and found that it only works if the records with the same "CompanyName" are beside each other in the table. More specifically, the VBA code processes each record based on the order of primary key in the table. Is there a way to accomplish the goal of the original poster if records aren''t adjacent in the table?

Thank you for your help!

推荐答案

可以轻松修改解决方案,以在SQL中包含ORDER BY子句。在我的所有测试中,我从未发现它是必要的,因为GROUP BY子句暗示相同。如果您发现这是一个问题,那肯定是要做的事情。
The solution can be modified easily to include an ORDER BY clause in the SQL. In all my testing I never found it was necessary as the GROUP BY clause implied the same. If you are finding this is a problem though, that is certainly the thing to do.


感谢您的回复;我不确定是否有人会监视此帖子的新帖子。在阅读了这个主题以及顶部解决方案中链接到的主题之后,你真的非常了解。


我沿着这些方向运行SQL:
Thank you for responding; I wasn''t sure if anyone would be monitoring this thread for new posts. You''re really quite knowledgeable after reading this thread and the one linked to in the solution at the top.

I''m running SQL along these lines:
展开 | 选择 | Wrap | 行号


这个帖子是添加到将一个字段的多个行组合成一个结果并引用该线程。
This thread was a post added to Combining Multiple Rows of one Field into One Result and refers to that thread.


这篇关于组合行 - 排序顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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