Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListMin() & ListMax()

Lists

ListMin() & ListMax()

by  webmigit  Posted    (Edited  )
Alright, you can find a few places to download UDFs for finding the least numeric value in a list or the greatest numeric value in a list. I may put my own versions here later on.

I read in an article by a well-known cf'er that if you want to get the minimum value of a list, you would need to loop over it.

That's not true. The following isn't pretty but its a lot faster than using a cfloop.

Finding the minimum value
ListFirst(ListSort(NumericList_Name, "numeric", "asc"))

Finding the maximum value
ListFirst(ListSort(NumericList_Name, "numeric", "desc"))
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top