Consider the following example when run from the command console of MySQL:
Code: Select all
mysql> select timediff("2014-04-05 13:00:00", "2014-04-02 13:00:00");
+--------------------------------------------------------+
| timediff("2014-04-05 13:00:00", "2014-04-02 13:00:00") |
+--------------------------------------------------------+
| 72:00:00 |
+--------------------------------------------------------+
1 row in set (0.00 sec)
When executed in MyDAC as this:
Code: Select all
procedure TForm5.Button1Click(Sender: TObject);
var Result : String ;
begin
MyConnection1.Server := 'localhost' ;
MyConnection1.Port := 3306 ;
MyConnection1.Username := 'user' ;
MyConnection1.Password := 'pw123' ;
MyConnection1.Connect ;
MyQuery1.Connection := MyConnection1 ;
MyQuery1.SQL.Text := 'select timediff("2014-04-05 13:00:00", "2014-04-02 13:00:00");' ;
MyQuery1.Execute ;
Result := MyQuery1.Fields[0].AsString ;
end;Is this a bug or am I doing something wrong?