tags:

views:

62

answers:

2

Hi 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 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 its working fine. such as i tried

SELECT DATEDIFF('2008-11-30','2008-11-29') DURATION
A: 

DATEDIFF (MI,timein,timeout)

why do you have three arguments in datediff?

Omnipresent
+1  A: 

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.

Guffa