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
Can you give an example of what you mean with the desired results?
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 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.bigge stnumber#< /cfoutput>
<cfquery name="yourQuery" ...>
SELECT MAX(ColumnA) AS biggestnumber
FROM YourTable
</cfquery>
<cfoutput>#YourQuery.bigge
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?
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_dayoth e>
<cfset A_day04_3=getdata.A_day04_
<cfset A_day05_2=getdata.A_day05_
<cfset A_day10_4=getdata.A_day10_
<cfset A_day11_3=getdata.A_day11_
<cfset A_day12_2=getdata.A_day12_
<cfset A_dayothe=getdata.A_dayoth
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks I like the list array! THANKS! Let me try it now!