Page 1 of 1

Different Declarations

Posted: 12.01.2011, 18:16
by majlumbo
I'm using ZEOS 6.6, Delphi 2006 and MySQL 5.1.
I have two different queries with similar selects, that is producing two different declaration types in Delphi

The 1st query

Code: Select all

select
...
datediff(curdate(), date_received) as "DaysInLab"
from
...
The 2nd query

Code: Select all

select
...
datediff(date_closed, date_received) as "num_days"
from
...
From the fields editor, I add all the fields, but I see that Delphi declares
DaysInLab as a TLargeintField
and
num_days as TIntegerField

Every so often, I get an error on the 2nd query saying that my query expects an integer field in num_days, but is receiving a Largeint. I simply delete num_days from the fields editor, add it again, and the query magically works again, only to happen again weeks later.

Any idea why the different declarations for what seems to be similar selects?

Posted: 18.01.2011, 04:45
by majlumbo
I ended up deleting the ZQuery and Datasource components, added them again, with the same query, and the after adding the fields in the fields editor, I checked the definition of num_days. This time it correctly declared num_days as TLargeintField. Everything seems to be working.