Link to home
Start Free TrialLog in
Avatar of FIATECH
FIATECH

asked on

Finding the max entered in the fields

Ok, I have 6 numeric textfields. I want to display the max of the 6 fields. How can I do this? The only appraoch I had in mind is with a list, but I know there's another way. maybe a quesry loop on the 6 fields to find the max? HELP
Avatar of _agx_
_agx_
Flag of United States of America image

Can you give an example of what you mean with the desired results?
Avatar of FIATECH
FIATECH

ASKER

yes. <cfoutput>#biggestnumber#</cfoutput>

if 10, 89, 35, 3, 5, 78 was entered I just want to get the saved result in the DB to display. SO maybe I can pull those variables from the DB and just show the max? Its sounds so easy but I can't do it!
If they values are entered into a column named "ColumnA" you could just use MAX

<cfquery name="yourQuery" ...>
SELECT MAX(ColumnA) AS biggestnumber
FROM   YourTable
</cfquery>

<cfoutput>#YourQuery.biggestnumber#</cfoutput>
Avatar of FIATECH

ASKER

well i don't want to pull the whole column. only those 6 values from that column.
How do you identify the 6 values, by ID or are they stored as a comma delimited list, or something else?  In other words what is a sample of the table data you're using?
Avatar of FIATECH

ASKER

I want these only form the table

<cfset A_day04_3=getdata.A_day04_3>
<cfset A_day05_2=getdata.A_day05_2>
<cfset A_day10_4=getdata.A_day10_4>
<cfset A_day11_3=getdata.A_day11_3>
<cfset A_day12_2=getdata.A_day12_2>
<cfset A_dayothe=getdata.A_dayothe>
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FIATECH

ASKER

Thanks I like the list array! THANKS! Let me try it now!