Hi, IMO AVG() should produce floating point result.
https://www.sqlite.org/lang_aggfunc.html#aggfunclist: The result of avg() is always a floating point value whenever there is at least one non-NULL input even if all inputs are integers.
In SQLite plays role column affinity. I expect that "km_gelaufen" is of NUMERIC or REAL affinity.
What result (in TDBGrid) gives: SELECT CAST(AVG(km_gelaufen) AS REAL) FROM laufdaten ?
L.
Ok, *solution* is to CAST AS Varchar the result: SELECT CAST(AVG(km_gelaufen) AS VARCHAR) FROM laufdaten But i don't understand why i do have to cast the result ...
-- _______________________________________________ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus