You need to be careful when subtracting dates-- if you treat them like integers, you'll probably not get the results you were expecting. Here's more discussion from the archive:
http://lists.mysql.com/mysql/172921
____________________________________________________________ Eamon Daly
----- Original Message ----- From: "listsql listsql" <[EMAIL PROTECTED]>
To: "Eamon Daly" <[EMAIL PROTECTED]>; "mysql" <[EMAIL PROTECTED]>
Sent: Tuesday, November 09, 2004 11:05 AM
Subject: Re: Emulating timediff in 4.0 ?
Thanks Eamon, I was trying with something like: SELECT stamp,now()+0, if ((now() - stamp)<6000, (now() - stamp) /60,0) as waitminutes from smstablademotaxi
//I'm interested to get it only for the last 60 minutes result: +----------------+----------------+-------------+ | stamp | now()+0 | waitminutes | +----------------+----------------+-------------+ | 20041109180348 | 20041109180455 | 1.78 | | 20041109180350 | 20041109180455 | 1.75 | +----------------+----------------+-------------+
Thanks for the feedback :)
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]