Variable number of columns in query

M

MFCVCS

What kind of query is necessary to implement the following:

Given : Access 2002, two tables
Table1 'Customer', Fields: ID, Name
Table2 'Order', Fields: ID, CustID, Product, Price

with Customer.ID linked to Order.CustID (one-to-many).

I would like to create a query that shows all orders for one customer in ONE row. Note: The number of orders varies from customer to customer, i.e. the output might look like this:

Customer1, Product1, Price1, Product2, Price2, Product3, Price3
Customer2, Product1, Price1,
Customer3, Product1, Price1, Product2, Price2

Ulitmately, I would like to export the data to a text file, tab delimitted.
Using DoCmd.TransferText with an export specification works nicely if the number of columns is fixed.
Any suggestions are greately appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top