At 23:39 -0800 12/16/02, Troy Kruthoff wrote:
>Description:
Invalid reporting of date calc
How-To-Repeat:
  note: SESSIONTS is TIMESTAMP type

  SELECT (NOW()-SESSIONTS) FROM WEBSESSIONS;
What leads you to expect that this should yield any useful result?

+-------------------+
| (NOW()-SESSIONTS) |
+-------------------+
| 1261 |
+-------------------+
1 row in set (0.00 sec)

mysql> SELECT (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(SESSIONTS)) FROM
WEBSESSIONS; +---------------------------------------------------+
| (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(SESSIONTS)) |
+---------------------------------------------------+
| 748 |
+---------------------------------------------------+
1 row in set (0.00 sec)
Fix:
  Cast fields as UNIX_TIMESTAMP to get valid seconds between to periods.

---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to