Connecting Tech Pros Worldwide Forums | Help | Site Map

List of Values with Select Query

Newbie
 
Join Date: Mar 2009
Posts: 4
#1: Mar 23 '09
Obviously a 'Group By' in a select query will show me all the values that exist for field.

Is there any way to show the result in a single row (concatenated) rather than multiple rows?

Normal Group by Example results in the following:
Requisition # Invoice #
PR1021 DJ0002
PR1021 DJ0015
PR1021 AB0156

I would like to see the following result instead:
Requisition # Invoice #s
PR1021 DJ002;DJ015;AB0156

Thank You for your help.

ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,214
#2: Mar 24 '09

re: List of Values with Select Query


Quote:

Originally Posted by Jlayne View Post

Obviously a 'Group By' in a select query will show me all the values that exist for field.

Is there any way to show the result in a single row (concatenated) rather than multiple rows?

Normal Group by Example results in the following:
Requisition # Invoice #
PR1021 DJ0002
PR1021 DJ0015
PR1021 AB0156

I would like to see the following result instead:
Requisition # Invoice #s
PR1021 DJ002;DJ015;AB0156

Thank You for your help.

I'm pretty sure that I can come up with a code-based solution if you are interested, just let me know. If you are interested, how would you like to see the results? (Debug Window, Text File, Table, List Box, Combo Box, etc.)? I'll check back later since there is probably a better, SQL based solution, but unfortunately I'm not the go-to SQL Guy! (LOL)!
FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#3: Mar 24 '09

re: List of Values with Select Query


Producing a List from Multiple Records
Newbie
 
Join Date: Mar 2009
Posts: 4
#4: Mar 24 '09

re: List of Values with Select Query


Thank you both. This is exacly what I needed.

jason
Reply