Access 中的 ConcatRelated(),使用两个键 [英] ConcatRelated() in Access, using two keys

查看:17
本文介绍了Access 中的 ConcatRelated(),使用两个键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了 ConcatRelated() 函数 [http://allenbrowne.com/func-concat.html],它似乎可以做我想做的事,但我需要输入两个键而不是一个.

I found the ConcatRelated() function [http://allenbrowne.com/func-concat.html] and it seems to do what I want it to, but I need to feed in two keys rather than just one.

我的数据看起来像:

Chain    Store      Warehouse
Walmart  Tucson     Phoenix
Walmart  Tucson     Flagstaff
Walmart  Phoenix    Phoenix
Bi-Lo    Phoenix    Phoenix
Bi-Lo    Phoenix    Flagstaff

而且我需要基于 Chain 和 Store 进行连接:

And I need to concatenate based on both the Chain and the Store:

Chain    Store      Warehouses
Walmart  Tucson     Phoenix, Flagstaff
Walmart  Phoenix    Phoenix
Bi-Lo    Phoenix    Phoenix, Flagstaff

你能帮我在括号内使用我需要使用的参数吗?

Can you help me with the arguments I need to use within the brackets?

推荐答案

你可以这样写:

SELECT Distinct
  tbl.Chain,
  tbl.Store,
  ConcatRelated("Warehouse","tbl","Chain=""" & [Chain] & """ and Store=""" & [Store] & """") AS Warehouses
FROM tbl;

这篇关于Access 中的 ConcatRelated(),使用两个键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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