<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Am 31.01.24 um 17:17 schrieb Santi via
lazarus:<br>
</div>
<blockquote type="cite"
cite="mid:346ad852-e19f-49cf-a01b-7313ac2b8d96@ciberpiula.net">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">El 31/01/2024 a las 14:32, n
Landmesser via lazarus escribió:<br>
</div>
<blockquote type="cite"
cite="mid:ace11a44-aa7c-4fc2-93e8-b14f24a17adb@gmx.de">
<meta http-equiv="content-type"
content="text/html; charset=UTF-8">
<p>An SQL satatement on a float field is displayed as an integer
field in a DBGrid. The fields are created "on the fly" they
are not static!</p>
<p><br>
</p>
<p><img src="cid:part1.hqV8nZ4N.d8XStMLC@gmx.de" alt="" class=""></p>
<p><br>
</p>
<p>SQL statement is:</p>
<p>"SELECT AVG( km_gelaufen ) FROM laufdaten"</p>
<p>SQL returns the correct value "2,00739263803681" if i copy
the value in DBGrid, but DBGrid itself shows only integer
value.</p>
</blockquote>
<br>
Look the format of the field component.<br>
Is it a TIntegerField? Maybe you selected the wrong field type, it
should be a TFloatField<br>
If it is a TFloatField, look at display format. Maybe you haven't
selected the number of decimal properly. <br>
</blockquote>
<p><br>
</p>
<p>There is just the Database and a TQuery and the DBGrid , i
execute the SQL code and lazarus DBGrid shows the result as
described above. <br>
</p>
<p>No static fielddefs with format options. The result field creates
lazarus "on the fly"<br>
</p>
</body>
</html>