Re: SQL command help



John wrote in message <120uuh07brbea89@xxxxxxxxxxxxxxxxxx> :
Anybody

I have two tables like so:

Employee:

Employee_ID Name
------------------------------------------
01 Hansen, Ola
02 Svendson, Tove
03 Svendson, Stephen
04 Pettersen, Kari

Orders:

Prod_ID Product Employee_ID
-----------------------------------------------------
234 Printer 01
657 Table 03
865 Chair 03

I want to create an SQL statement that will return the following result

Name ProductList
-----------------------------------------------------
Hansen, Ola Printer
Svendson, Tove
Svendson, Stephen Table, Chair
Pettersen, Kari


Basically, I want to return a new column with a list of all the orders. How
would I achieve this?

John

I think you'll need more than just SQL, I think you'll need to call a
VBA function, too.

Check out Duane Hookoms "Generic Function To Concatenate Child Records"
http://www.rogersaccesslibrary.com/OtherLibraries.asp

--
Roy-Vidar


.



Relevant Pages

  • Re: Problem using LEN function in WHERE clause on OLEDB Jet 4.0 driver
    ... Actually using Trim VBA function in a SQL statement will not work in all ... NULL rather than trim it. ... > The concatenation of and an empty string will transform any ...
    (microsoft.public.data.ado)
  • RE: how to call sql server 2000 stored procedure from foxpro
    ... John, this syntax didn't work. ... > This first example uses the output command to, in effect, pass the @SaleAmt ... > by reference into the stored procedure. ... > initialize the variable before you pass it into the SQL Statement, ...
    (microsoft.public.fox.helpwanted)
  • Re: Passing values from a multi-select list to a MySQL query using PHP
    ... John wrote: ... I have these items loaded into an array, and use this code to put them ... it is passed into my sql statement it will work properly? ... I'd suggest putting single quotes around the values before imploding the array, ...
    (comp.lang.php)
  • Re: Paragraph Format from Word in Memo Field
    ... John, tried to use the sql statement without the query grid by pasting this ... You want to remove the carriage return and replace it with a space. ... If you don't know how to build an update query without using the query grid, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Help!
    ... I would not want to speak for John, but below is an sql statement that uses ... This sql statement is just a totals type query. ... records and null in some records, using the Avg function will produce the ... I have learned much from your postings as well as the posting of ...
    (microsoft.public.access.forms)

Loading