[Lazarus] DBGrid displays Float as integer

LacaK lacak at zoznam.sk
Thu Feb 1 11:40:22 CET 2024


> If i execute: "SELECT CAST(AVG(km_gelaufen) *AS REAL*) FROM laufdaten" 
> the known problem of integer only shows up again.
>
> BUT:
>
> If i execute this "SELECT CAST(AVG(km_gelaufen)  AS REAL) FROM 
> laufdaten " in SQliteStudio it works as it should.
>
Ok then it is clear that SQLite produces result as expected

> Is DBgrid or Zeos Access components  the culpit? I don't know.
>
Do you use Zeos components not SQLdb (TSQLQuery)?
Can you test datatype of TField created at runtime?
For example place somewhere after dataset is Open-ed something like: 
ShowMessage(Fieldtypenames[Query1.Fields[0].DataType]);

L.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240201/bce77378/attachment.htm>


More information about the lazarus mailing list