Incorrect Minimum values


An integer field, every record containing the same, positive superdate, gives the wrong value on Minimum, either via Analyze menu or via aggregate(. Maximum gives correct values both ways. I discovered this with 1331 records of just 3599814258 resulting in a ‘minimum’ of 2147483647, but suspect the problem is wider than that in scope. I exported the data as text then reimported it into a new database, changed the field to integer and got the same results; ruling out something goofy with my original database.


If I fill those records with -3599814258 then maximum returns -2147483647 and minimum works correctly.

If there are any values less than 2147483647, minimum will return the correct value, and if there are any values greater than -2147483647, maximum will return the correct value.


In my experimenting I find in an integer field anything over 2147483647 returns 2147483647. If you change the field to Float you are not restricted to this limit.


It’s probably significant that 2147483647 is the maximum value for a 32 bit integer.


Holy quadruple underbyte!


Apple’s code apparently confused me, and I picked the wrong constant. So minimum won’t currently work if ALL values are larger than 2147483647 (as David already stated). I haven’t tested this yet, but I think that maximum probably doesn’t work if all values are more negative than -2147483647. Should be an easy fix (famous last words).