Gabriel Alessandria wrote:


I am a user of Microsoft Sql Server and use very much the function Datediff
(interval, fecha1, fecha2) to extract differences between two dates, in
years, days, months, hours, etc

I am a beginner with MySql and i can't see the way to do this function ..
How can I extract for example difference of hours between two given dates ..
someone help me please ?

Thanks in advance

Not quite sure what it means to get the difference between two dates in months or hours, but mysql does have a DATEDIFF function:


DATEDIFF(expr,expr2)
  DATEDIFF() returns the number of days between the start date expr and
  the end date expr2. expr and expr2 are date or date-and-time
  expressions. Only the date parts of the values are used in the
  calculation.

For more date functions, see the manual:

<http://www.mysql.com/doc/en/Date_and_time_functions.html>

Michael


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to