STRANGE problem with SUM
Posted: 10.03.2007, 08:43
Hi!
I'm have a GREAT trouble using the SUM command in my ZEOS. Hi is my system :
- Borland Delphi 7 and BDS 2006 (the trouble is the same in both)
- Zeos 6.5.1-alpha CVS-Version in Delphi 7
- Zeos 6.6.1 beta in BDS 2006
- MySQL 5.0.22
- Windows XP SP2
The trouble is basicaly I can't make a simple SUM in a QuickReport collumm (using a QREXPR component ).
I am not sure, but I think its because the ZQuery component makes the "SUM column" as TStringField in Zeos 6.5.1-alpha and TLargeintField in Zeos 6.6.1 beta.
The most strange is, if a make a SUM with a "non-SUM column" , the SUM works absoluty fine.
Example :
Table ORDERS in MySQL 5, innoDB :
ord_cod : integer(3)
ord_amount : integer(3)
Now,the following SQL statement using ZQuery:
"select ord_cod, sum(ord_amount) as ord_amount
from orders"
if I try make a SUM of "ord_amount", I will put a QREXPR component in the QuickReport and make the expression : Sum(ZQuery1.ord_amount) , right?
The Result : nothing. A blank field.
BUT, if I make a SUM with the field "ord_cod" the expression : Sum(ZQuery1.ord_cod) will works!
Anyone can understand what is wrong?
I think if ZEOS makes a SUM column as TIntegerField its might be works.
Thanks for any help,guys!
I'm have a GREAT trouble using the SUM command in my ZEOS. Hi is my system :
- Borland Delphi 7 and BDS 2006 (the trouble is the same in both)
- Zeos 6.5.1-alpha CVS-Version in Delphi 7
- Zeos 6.6.1 beta in BDS 2006
- MySQL 5.0.22
- Windows XP SP2
The trouble is basicaly I can't make a simple SUM in a QuickReport collumm (using a QREXPR component ).
I am not sure, but I think its because the ZQuery component makes the "SUM column" as TStringField in Zeos 6.5.1-alpha and TLargeintField in Zeos 6.6.1 beta.
The most strange is, if a make a SUM with a "non-SUM column" , the SUM works absoluty fine.
Example :
Table ORDERS in MySQL 5, innoDB :
ord_cod : integer(3)
ord_amount : integer(3)
Now,the following SQL statement using ZQuery:
"select ord_cod, sum(ord_amount) as ord_amount
from orders"
if I try make a SUM of "ord_amount", I will put a QREXPR component in the QuickReport and make the expression : Sum(ZQuery1.ord_amount) , right?
The Result : nothing. A blank field.
BUT, if I make a SUM with the field "ord_cod" the expression : Sum(ZQuery1.ord_cod) will works!
Anyone can understand what is wrong?
I think if ZEOS makes a SUM column as TIntegerField its might be works.
Thanks for any help,guys!