Lets say you have the following fields? Field1,Field2,Field3,Feild4
I would do this, default the sort on field 1:-) SELECT #form.fieldlist# FROM #form.tablelist# WHERE #form.wherefield# #form.conditional# #form.WhereClause# Order by #form.field1# Or you could just cache the query, this way you aren't hitting the DB as much!! Regards, Andrew Scott -----Original Message----- From: G [mailto:[EMAIL PROTECTED]] Sent: Thursday, 27 September 2001 22:20 PM To: CF-Talk Subject: Reclaiming results of dynamic query I've got a unique situation thats got me a bit stuck. I've got a query that is completely dynamic, as such: SELECT #form.fieldlist# FROM #form.tablelist# WHERE #form.wherefield# #form.conditional# #form.WhereClause# The results of the query are displayed in a table, with the column headings as links who's intention is to allow for the table to be resorted by clicking on the heading. The problem is, how to get the myriad of FORM variables i've got (which essentially build the report), passed through to the report as it is re-generated with the new order by clause? For obvious reasons, I don't want to use URL variables. I have not played with some of the new features in CF 5, but we will be moving there soon. Perhaps query-a-query can help me? Or is there some way that I can get at the cached results of the query (without rewriting the query) thereby eliminating the need to pass through those variables again? Hopefully this makes sense. Thanks, Brian Grant Programmer/Analyst MATCOM, Inc. Leawood, Kansas [EMAIL PROTECTED] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

