I am trying to calculate duration. I am using MySQL 5.0 but I am getting this error
1305 - FUNCTION smgm.DATEDIFF dose not exist
My query 开发者_Python百科is:
SELECT DATEDIFF (MI,timein,timeout)/60 as duration
FROM User_smgm
where ID=2;
my database name is SMGM
Any Idea why is this so? Where as when I try simple DATEDIFF it's working fine. Such as I tried
SELECT DATEDIFF('2008-11-30','2008-11-29') DURATION
The datediff
function in MySQL gets the difference in days. There is no overload where you can specify a time period. Use the date_sub
function instead.
DATEDIFF (MI,timein,timeout)
why do you have three arguments in datediff?
精彩评论