views:

352

answers:

2

I create an MS Access 2007 query where the same customer has multiple project and data appear like:

1 | Foo
1 | Bar
1 | Baz
2 | For
3 | Cad
3 | Cam

and I want to transform it into something like

1 | Foo | Bar | Baz
2 | For |
3 | Cad | Cam |

The goal is to create a spreadsheet view per customer (1,2,3) which can be read from word in order to create mailings per client

A: 

There is a very informative Database Journal article that does something similar to what you want; however, it states that there is no way to this in a query, and so it must be done in VBA.

Matthew Jones
A: 

I guess this is duplicate of http://stackoverflow.com/questions/965981/can-sql-access-display-foreign-key-rows-as-columns - which I answered.

Is that the case?

shahkalpesh
Not really, pivot transform in access uses something like TRANSFORM sum() AS total [...]PIVOT mytable.which does not really solve it for me. If you could help me write the statement for the above example I would appreciate it.
I am sorry, I misunderstood your question. I don't think there is anything built-in which can get you the output you are looking for. How many such records could be there for a given ID?
shahkalpesh