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

concatenate values from two tables into single table?

Status
Not open for further replies.

impulse24

IS-IT--Management
Jul 13, 2001
167
US
Hi,

I can't figure this one out.

I have two tables:
BatchPage
BatchField

BatchPage structure:
DocID
PageID

BatchField Structure:
DocID
IndexFieldValue

Example Data in BatchField:
DocID IndexFieldValue
1 Barcode
1
1 Permission
1

Example Data in BatchPage:
DocID PageID
1 1
1 2
1 3

I want to perform a query that will output the results as follows:

DocID IndexValues PageIDInDoc
1 Barcode,,Permission, 1,2,3

I am basically combining multiple records from the two tables into a single record in a new table. I have used a cross query but it is outputting multiple records with the matching docid's. Please help.
 
Try using cursors.

Rather than me explain in detail, let me know if you don't know how to do it and then I shall demo.

john.wood@vantage-vts.co.uk

Woody.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top