Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2011, 01:10 PM
Registered User
 
Join Date: Mar 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA SQL for all values 1 field

I'm new to this site and just signed in. I'm hoping this can get me out of a hole sometimes that i'm in. I'm very stumped right now and googled for the answer and no luck. But what I'm looking for is how to pull in all values from 1 field in a table and exporting into 1 cell alone in excel.

example:
sql = "SELECT PARENT, KIDS FROM DATABASE"

output:

parent kids

Bob Joe
Bob Mary
Bob Susan


I'm wanting output to be:

parent kids

Bob Joe,Mary,Susan

Last edited by DaltonMan; March 17th, 2011 at 03:34 PM..
 
Old March 17th, 2011, 03:41 PM
Registered User
 
Join Date: Mar 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 1 day

It's already been viewed by over 50.....I know 1 of you has to know the answer. I found things like CONCAT() or GROUP_CONCAT() but concat was mainly to combine 2 diff fields into 1 cell and group_concat throws me up an not in library error. And i'm doing this in excel 2007 workbook in VBA.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to concatenate two values into one field haixia XSLT 3 November 7th, 2016 02:33 PM
Help with Unbound Date field to link with SQL VBA JackalBW BOOK: Access 2003 VBA Programmer's Reference 0 December 9th, 2007 06:29 AM
get the values of form field values crmpicco Perl 2 March 16th, 2007 10:57 AM
Parsing values out of a field 12th_Man Oracle 1 March 3rd, 2005 10:51 AM
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.