But I would suggest trying to format everything as a string whose ASCIIbetical sort is the order you want, and then do one max. For instance format numbers to show you all leading 0's to some fixed width, format dates as YYYYMMDD:HH:MM:SS, strings as themselves, etc.

No, it is not perfect. But it should run fairly quickly.

Cheers,
Ben