Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

get max of a query?

$
0
0

i want to get the max of this query.

<cfquery datasource="intranet" name="getMaxstars">
select submitterdept, sum((rating1+rating2+rating3+rating4+rating5)/5)/count(1) average_rating  
from CSEReduxResponses  
group by submitterdept  
order by 2 desc;  </cfquery><cfset myarray=[submitterdept] ><cfoutput  query="getMaxstars"><h1>#ArrayMax(myarray)#</h1></cfoutput>

this code doesnt work. the query does, it will output 3 rows , so from this rows i want to get

the max of submitterdept, is there a different way to do this?

with the code abobe i get  'Variable SUBMITTERDEPT is undefined.'


Viewing all articles
Browse latest Browse all 5794


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>