tags:

views:

60

answers:

1

I've got a db like this:

Accounts 
--------
id
BankName
AcctNumber
Balance

AccountGroups
-------------
id
GroupName

JoinAccountsGroups
------------------
aid
gid

I'm trying to generate data like this:

Bank       AcctNum       Balance    Groups
--------|--------------|----------|----------------
Citi       930938        400        Payroll
B of A     8372933       100        Monthly, Payroll
Wells      09837         800        -
Chase      8730923       250        Monthly

Is there an easy way of generating that Groups column in a sql query, that will combine the results of the join into a comma-separated field? I'm currently doing it on the php side using a secondary query on each row as I'm processing it. It's fine for a small dataset, but it seems pretty inefficient...

I'm using php > jet > ms access .mdb file.

A: 

This may help http://stackoverflow.com/questions/230241/does-ms-access2003-have-anything-comparable-to-stored-procedure-i-want-to-run

Varun Mahajan
I'm not sure how that gets to be counted as a correct answer, since VBA functions can't be executed via ODBC or OLEDB.
David-W-Fenton