Page 1 of 1

7.0 SVN MySQL calculated field content is returned as ??

Posted: 20.05.2011, 03:30
by bobo
The following SQL statement executed on a MySQL 5.x table with TZQuery

Code: Select all

SELECT DATE_FORMAT( CTime, '%Y/%m/%d' ) AS FClicked, count( * ) AS Cnt
FROM TableName
GROUP BY FClicked
ORDER BY FClicked
the field value of the result set field "FClicked" always returns '??' instead of the date values (the query is executed properly and the records are returned properly).
This works with 6.6.6 stable, but not with the SVN version of 7.0 alpha.

Tried with
Fields[0].AsString
FieldByName('FClicked').AsString
FieldByName('FClicked').AsDateTime (gives exception of course, since '??' is not a valid date)

Tested on Win32 and Linux32 .

Posted: 20.05.2011, 13:16
by ism
Maybe

SELECT DATE_FORMAT( NOW() , '%Y/%m/%d' ) AS FClicked, count( * ) AS Cnt
FROM TableName
GROUP BY FClicked
ORDER BY FClicked

because CTime is Microsoft SQL Server function

Posted: 20.05.2011, 19:30
by bobo
I just replaced the real field names I have in my example, so that is not the problem.
Plus, as I've mentioned I use MySQL server.
And, as I've mentioned it works properly with 6.6.6 stable.

Posted: 21.05.2011, 20:16
by ism

Posted: 22.05.2011, 00:40
by bobo
Yes, this fixes it. Thanks.