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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fields from more records into one record

Status
Not open for further replies.

OldSmelly

Programmer
Nov 22, 2001
70
NL
Hello Again,

Is there a way to put the fields from multiple recors into one record. Let me explain what I mean....

I have created a table with the sql inner join command so the dest table can have multiple record for any given idnr (the join) But my client whant's to have a excel sheet with all the fields in one record so for example one person can have X employer recors so in the dest table this person has X records is their a way to put all these fields in ONE record so I can export it to excel short of programming a dest table with all these fields. Because I don't know how manny X recors a person can have....

Thanks in advance
 
You could do it a number of ways with some sort of loop, but if 255+ columns might happen with normal use, you're going to have a problem. Depending on the record field count you might hit the limit pretty quick.

Post a sample data of the records you want to export if you need more help.

Brian
 
Thanks Brian,

When you do it in a loop (I have done a test that way) you have to create a table with al the fields in it prior to the loop so you can put field X from record X in it's field in the dest table. I was hoping that their was an other way of doing it.. Youre right about the 255 limit So I have to put in some sort of MAX in the loop so it won't go over this limit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top