I have a query ("GetTotals"). I'm adding a column there from the other query ("GetTheList") using the standard code:
<CFSET myArray = ArrayNew(1)>
<cfloop query="GetTheList">
<CFSET TotalJobs = GetTheList.Total>
<CFSET x = ArrayAppend(myArray,TotalJobs)>
</cfloop>
<CFSET x = QueryAddColumn(GetTotals, "Totals", "VarChar", myArray)>
<CFOUTPUT QUERY="GetTotals"> shows everything the way I need.
Except for one problem: How I order the output by that added column?
Simple re-order (below) works for one column only but not for all of them.
<cfquery name="ResortQuery" dbtype="query">
SELECT *
FROM GetTotals
ORDER BY Totals DESC
</cfquery>
All ideas are appreciated!