Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create 2 copies of each record and export as csv? 1

Status
Not open for further replies.

TSimonick

Technical User
Sep 6, 2001
39
US
Hi,

I need to select records and then export them as a csv file. The trick is that I need to duplicate each record before exporting: I figured on using a query to select the records, but how do dulicate them so that they will look like this in the csv fle?

ID1, Smith
ID1, Smith
ID2, Jones
ID2, Jones
etc.

Will someone point me in the right direction to do this?

Thanks in advance,

Tom
 
Hello Tom,

I don't know about the export step but this will get you your duplicate records. Maybe someone will post an elegant way to do this, but this works.

Create a dummy table with 2 records in it. Create a query containing all of the data you need for your export and include the dummy table with the 2 records without linking it at all. Select a field from the dummy table and uncheck the checkbox so it doesn't show.

When you run the query, you will get a Cartesian Product of your records since you included an unlinked table.

Good Luck with the rest of the process! Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need![thumbsup]
 
Thanks for the suggestion - works great!!

Regards,

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top