Try with TOTAL instead:

TOTAL(km_gelaufen) as km_gelaufen

Or with ROUND:

ROUND(TOTAL(km_gelaufen), 3) as km_gelaufen


Em 19/07/2024 09:40, John Landmesser via lazarus escreveu:
  Hi,

  why do i have this format issue with aggregat function as SUM quering
a SQLite Database with DBGrid and TQuery?


No format issues if i use in terminal:

./sqlite3 -table ./laufdaten.db 'SELECT SUM( km_gelaufen )  FROM laufdaten;'
+--------------------+
| SUM( km_gelaufen ) |
+--------------------+
| 978.639            |
+--------------------+

But using DBGrid and ZQuery from ZeosLib i get:

SUM(km_gelaufen );
9,8E2;

That scientific notation is only shown in DBGrid, the correct value
978.639 is copied to clipboard by Ctrl + c

I googled and found a workaround but i would like to know: why is the
DBGrid using this scientific notation ?

The issue is of course gone if i have persistant field definitions where
i can set Field.Displayformat


Tipps are welcome


John



--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to