<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Hi,<br>
<br>
IMO AVG() should produce floating point result.<br>
<br>
<a class="moz-txt-link-freetext" href="https://www.sqlite.org/lang_aggfunc.html#aggfunclist">https://www.sqlite.org/lang_aggfunc.html#aggfunclist</a>: 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.<br>
<br>
In SQLite plays role column affinity. I expect that "km_gelaufen" is
of NUMERIC or REAL affinity.<br>
<br>
What result (in TDBGrid) gives: SELECT CAST(AVG(km_gelaufen) AS
REAL) FROM laufdaten ?<br>
<br>
L.<br>
<br>
<blockquote type="cite"
cite="mid:f89a3478-f423-4f27-b7c3-fad81d11fbef@gmx.de">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<br>
<p>Ok, <b>solution</b> is to CAST AS Varchar the result:</p>
<p>SELECT CAST(AVG(km_gelaufen) AS VARCHAR) FROM laufdaten</p>
<p>But i don't understand why i do have to cast the result ...<br>
</p>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
</blockquote>
<br>
</body>
</html>