access合并多行列数据到一行,类似于mysql的group_concact()函数
(Q)??? I need to concatenate a field in the format "Value1; Value2;Value3" etc. for each unique value of another field in the same table.? How canI do this?
(A)??? Using the fConcatFld function,? in the Northwind database,the following query should return a concatenated list of all CustomerIDs if you group byContactTitle.
使用方式:
SELECT ContactTitle,fConcatFld("Customers","ContactTitle","CustomerID","string",[ContactTitle])AS Customers FROM Customers GROUP BY ContactTitle;
?
参数说明:
fConcatFld参数说明stTable As String 表名称?_stForFld As String, 查询的条件字段名称_stFldToConcat As String, 合并的字段名称_ stForFldType As String, 合并字段的类型_vForFldVal As Variant 合并字段的查询条件
'************ Code End **********