That's definately a clever way to crack that nut, thanks Charlie. In this case the source query won't be too big.
But it seems odd that after all this time with <CFSCRIPT> we still don't have a Query(); function. -----Original Message----- From: Charlie Stell [mailto:charlie.st...@gmail.com] Sent: Wednesday, May 26, 2010 2:18 AM To: cf-talk Subject: Re: Retrive query cell value by key/value pair instead of row number? When I've had to deal with the same situation previously, I usually created a "lookup" structure based on the column ill use as a handle - mystruct[value I want to ref by]=row index from query (this struct would get populated by looping over whole query) . This index then can be used to get at that row... I do seem to remember however that there's now a cfscript verion of cfquery (I don't remember if it supports query of querys). If that doesn't work, you could write a function that takes a colname, col value and query name, and perform a qoq- assuming the function will have access to the original query... Hope that helps! On 5/26/10, Jon Sala <jon.s...@albertahealthservices.ca> wrote: > > Is it possible to retreive from a query in memory a cell value by a > key value pair, ie other than the usual row number: myquery.columname[i]? > Something like myquery.columname[myquery.keyval:thisquery.Id] > For example, in a <cfscript> block I'm looping through a query, and > under certain conditions I need to retrieve a cell value from a > previous query using a current keyval. > > I guess the real problem is I'm looking for a simple equivalent to > <cfquery> usable inside <cfscript>. Is > coldfusion.server.ServiceFactory the only way out? > > Don't even know if any of this makes sense... I think I need to get > some sleep. > > -- > Jon > > This message and any attached documents are only for the use of the > intended recipient(s), are confidential and may contain privileged > information. Any unauthorized review, use, retransmission, or other > disclosure is strictly prohibited. If you have received this message > in error, please notify the sender immediately, and then delete the original > message. Thank you. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334005 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm