|
喊救命还不如自己先认真研究研究。
提供你一个方法,没做过试验,应该是可以的。先做一个函数:
public function aaa("艺术家字段" as string, "表名" as string, "唱片ID" as string,optional bbb as string)
dim rst as dao.recordset
set rst = currentdb().openrecordset("select * from " & "表名" & IIf([唱片ID] = "", "", " Where " & "唱片ID"))
aaa = rst("艺术家字段")
rst.MoveNext
do while not rst.eof
aaa = aaa & bbb & rst("艺术家字段")
rst.movenext
loop
end function
再做一个查询:
select 表1.字段1, aaa("[艺术家字段]","表名","[唱片ID]='" & [唱片ID] & "'") AS 表达式1
from 表名
group by 表名.唱片ID;
注意:艺术家字段、表名、唱片ID 都是字符串,不是数值。 |
|