Find the max value of a field
J

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.

Ninox Profile

last()

 

Leo

Ninox Profile

@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'

 

Ninox Profile

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

J

It works, thank you both!

Reply