0

Find the max value of a field

It looks like that the max function works for numbers. But my field has letters in it. How can I find the max value of this field? Thank you.

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • last()

     

    Leo

    Like
    • Mconneen
    • Mconneen
    • 3 yrs ago
    • Reported - view

    @Leonid... Last will give you last record in the set... so you need to combine that with an order by clause.. and to account for mixed ASCII sorting where lower case letters sort AFTER upper case.. you may want to convert them all to the same case .. if your search is to be case insensivity.. 

    Assume you have a People table.. .andt there is a column called 'Last Name' .. to find the greatest value of last name.. case insensitive... 

    let p:= last((select People) order by upper('Last Name'));
    p.'Last Name'

    Like
  • That's right, I should have explained that before.

    Like
  • It works, thank you both!

    Like
Like Follow
  • 3 yrs agoLast active
  • 4Replies
  • 1806Views