[Lazarus] DBGrid displays Float as integer
LacaK
lacak at zoznam.sk
Thu Feb 1 07:51:44 CET 2024
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 ...
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240201/b0928208/attachment.htm>
More information about the lazarus
mailing list