Jump to content

DateTime Error


Dan_Mason

Recommended Posts

Hello there!

 

I have written this MySQL function:

 

DROP FUNCTION IF EXISTS optimaldb.TBC;
CREATE FUNCTION optimaldb.`TBC`(SectionID int(10), StartTime datetime) RETURNS datetime
BEGIN
  DECLARE PrevTime datetime;
  SELECT EndTime FROM PassSection WHERE EndTime < StartTime ORDER BY SectionID LIMIT 1 INTO PrevTime;
  RETURN StartTime - PrevTime;
END;

 

Into which I pass 2 variables i.e:

SELECT TBC(3451,'2010-04-01 06:03:12')

 

This is the error that keeps getting thrown up: MySQL Database Error: Incorrect datetime value: '9188914574.000000' for column 'TBC' at row 1

 

I'm not entirely sure what I have done wrong  :confused: as I have looked up this: http://dev.mysql.com/doc/refman/4.1/en/datetime.html and as far as I can see I am structuring the datetime correctly!

 

Any help would be really handy! :D

 

Thanks, Dan

 

Link to comment
https://forums.phpfreaks.com/topic/239435-datetime-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.