ok i tried the ValueList syntax as per Steve Onnis, but i get an error message -
"The ValueList() function has an invalid parameter: SelectedOrders.SalesHDRID. Parameter 1 of function ValueList which is now (SelectedOrders.SalesHDRID) must be pointing to a valid query name." 'SelectedOrders' is a valid query name. So i am not sure what the cause of error is. Also i am writing this query in COldFusion and the backend is SQL Server Express 2005. 'SelectedOrders' for my test cases is returning less than 10 records. In the production environment it might return at the max a 100 records, so valuelist shoul;d definitely work... DOes anyone know y am i getting an error? Steve Onnis wrote: > SELECT salesdetail.packerid > FROM SALESDETAIL > WHERE SALESDETAIL.SalesHDRID IN > (#ValueList(SelectedOrders.SalesHDRID)#) > > That will output all the items returned from that column into your query > > -----Original Message----- > From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf > Of Khush > Sent: Wednesday, 12 November 2008 9:02 AM > To: cfaussie > Subject: [cfaussie] Referencing a query inside another query in ColdFusionMX > > > How do i reference a field (SalesHDRID) from a query (called > SelectedOrders) in the where condition of another query. > > My CF query looks somewhat like this- > SELECT salesdetail.packerid > FROM SALESDETAIL > WHERE SALESDETAIL.SalesHDRID IN (SelectedOrders.SalesHDRID) > > Now my query SelectedOrders is a really big and very complicated one, > so I am not going to just paste it in the IN clause...If anyone has > any ideas how to actually reference this sub query by it;s name in the > main query above, please let me know ASAP as i need this urgently... > > > THanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---