This is VERY untested psuedo/code, but you could take an approach similar to
this and just build a new query recordset from the first query. There may
be simpler ways, but this was the first thing that popped into my mind
(usually a bad sign!)
<cfscript>
qNewQuery = querynew("id,clientName,food");
//through your clientNames
for (i=1;i LTE [whatever number of clients];i=i+1) {
queryAddRow(qNewQuery,1);
querySetCell(qNewQuery,"ID",[this id],i);
querySetCell(qNewQuery,"clientname",[this client name],i);
// set new empty food list
foodList = "";
//loop through the foods for this client and add to food list
for (j=1;j LTE [the number of foods for this client];j=j+1) {
foodList = listappend(foodList,[this food item])
}
//set the query cell = to the food list
querySetCell(qNewQuery,"food",[this food item],i);
}
</cfscript>
And please check the syntax. I didn't! :D
On 12/5/05, Kevin Fricke <[EMAIL PROTECTED]> wrote:
>
> Eric:
>
> I have a reservation table with various entries regarding date, times,
> etc.
>
> I have a food table which has the name, descriptions, etc. of the various
> food options
>
> I then have a join table to join the two together on reservation_id &
> food_id.
>
> I would like to run a query where all of the food_id's get dropped into
> one
> field. This may not be possible, but I thought I would pose the questions
> to the group.
>
> Kevin
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On Behalf Of Knipp, Eric
> Sent: Monday, December 05, 2005 10:53 AM
> To: 'Dallas/Fort Worth ColdFusion User Group Mailing List'
> Subject: RE: [DFW CFUG] queries
>
> Kevin,
>
> It depends what the table(s) you're using look(s) like. If you have
> multiple fields for food values you could concatenate them together, but I
> am not sure if that is the case.
>
> Eric
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Kevin Fricke
> Sent: Monday, December 05, 2005 10:49 AM
> To: CFLIST
> Subject: [DFW CFUG] queries
>
>
> How do I pull a list of values into one column of a query result? Is this
> possible?
>
> For example, I have a list of reservations. With each reservation there
> may
> be a number of food options selected.
>
> Is it possible to run a query which will return the following results?
>
> ID | Client Name | Food 1,Food2,Food3 | etc.
>
> Kevin
>
>
>
> _______________________________________________
> List mailing list
> Reply to DFWCFUG:
> [email protected]
> Subscribe/Unsubscribe:
> http://lists1.safesecureweb.com/mailman/listinfo/list
> List Archive:
> http://lists1.safesecureweb.com/mailman/private/list
> DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/
>
> CONFIDENTIALITY NOTICE: The information contained in this e-mail and
> attached document(s) may contain confidential information that is intended
> only for the addressee(s). If you are not the intended recipient, you are
> hereby advised that any disclosure, copying, distribution or the taking of
> any action in reliance upon the information is prohibited. If you have
> received this e-mail in error, please immediately notify the sender and
> delete it from your system.
>
> _______________________________________________
> List mailing list
> Reply to DFWCFUG:
> [email protected]
> Subscribe/Unsubscribe:
> http://lists1.safesecureweb.com/mailman/listinfo/list
> List Archive:
> http://lists1.safesecureweb.com/mailman/private/list
> DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/
>
>
>
> _______________________________________________
> List mailing list
> Reply to DFWCFUG:
> [email protected]
> Subscribe/Unsubscribe:
> http://lists1.safesecureweb.com/mailman/listinfo/list
> List Archive:
> http://lists1.safesecureweb.com/mailman/private/list
> DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/
>
--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com
_______________________________________________
List mailing list
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archive:
http://lists1.safesecureweb.com/mailman/private/list
DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/