How to export csv with variable number of columns?
August 19, 2009 10:57 AM
Subscribe
Using a relational table in a one-to-many relationship in Access, what is the best way to export a csv file with one row per record (from the one half) with a variable number of columns (from the many half)?
Basically, I have a Senator with one or more staffers. I want to export (CSV) so that it looks like:
Senator 1 info | Staffer 1 info
Senator 2 info | Staffer 1 info | Staffer 2 info | Staffer 3 info
Senator 3 info | Staffer 1 info | Staffer 2 info
One row per senator, but an unknown or changing number of columns.
I'm sure there's a way to do this via query. I have to make this as easy as possible (via a button on a form) for a coworker.
Having a hard time finding an answer via Google.
posted by JeremiahBritt to computers & internet (6 comments total)
1 user marked this as a favorite
I'm assuming you're doing this in query designer? Right click the little line that ties the two tables together in design view. It'll give you a few options -- I think you want a left join. But change it and try a different join and if it doesn't work, try another.
posted by A Terrible Llama at 12:37 PM on August 19