Page 1 of 1

Problem with MySQL time values

Posted: Tue 13 May 2008 16:55
by snorkel
Give the query below:

Select TIMEDIFF('1997-12-31 23:59:59.000001','1997-12-30 01:01:01.000002');

it should return:
46:58:57

but when I run it with the Quantum Grid it displays as:
22:58:57

I believe this is because the delphi ttime object won't dispaly more than 24 hours, but I am not sure.

I am not sure if this is a grid issue or if the Mydac query should be mapping it to a string type instead of a ttime type.

Posted: Fri 16 May 2008 11:56
by Dimon
The Delphi Time object doesn't allow keeping time more than 24 hours. If you want to work with larger time you can get data as string and process it yourself.
For this you can use the following query:

Code: Select all

Select CAST(TIMEDIFF('1997-12-31 23:59:59.000001','1997-12-30 01:01:01.000002') AS CHAR);