Andrew,
 
 I think something like this will do it (not tested):
 
<cfloop query='myQuery'>
  <cfset lo=  99999999>
  <cfset hi= -99999999>
  <cfloop list="field_a,field_b,field_c,field_d" index="item">
    <cfif evaluate('myQuery.#item#') LT lo>
      <cfset lo= evaluate('myQuery.#item#')>
    </cfif>
    <cfif evaluate('myQuery.#item#') GT hi)>
      <cfset hi= evaluate('myQuery.#item#')>
    </cfif>
  </cfloop>
  <!--- hi and lo now contain highest and lowest values --->
 
</cfloop>
 

Bob
----- Original Message -----
Sent: Tuesday, May 07, 2002 10:37 AM
Subject: [CFTALKTor] High and low's

Is there an easy ( ha, ya right!) way to find the highest and lowest values within a single record when looking at multiple fields.

 

Example:

 

In record One…

Which is highest? Field a, field b, field c or field d

Which is lowest? Field a, field b, field c or field d

 

 

Andrew Green

Reply via email to