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.