Problems with Sum() and Decimal Fields

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply

Problems with Sum() and Decimal Fields

Post by MvS » Thu 20 Oct 2005 13:25


I Use D2005, MySQL 5.0.13 and a registered version of DBExpress Driver 2.60.7.

When I use a SQL-Statement with TSimpleDataset like:

Code: Select all

Select a, sum(Decimal field) as b from 1 group by a
Field b becomes a TFMTBCDField
According to the readme file it should be a TBCDField
How can i fix this problem, because it shows now incorrect values when I use a TDBGrid.


Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 20 Oct 2005 14:00

The reason of this behavior is increasing of field precision.
You should use CAST statement to decrease precision back.

Post Reply