Hello List,
Is it true that the date_sub function(s) will only work on datetime column
types?
SELECT count(id) as id FROM messages WHERE client_id = '2' AND datetime_col
> date_sub(NOW(),interval 1 day)
To get the above query to work, I had to change my datetime_col column from
timestamp to datetime, and that breaks A LOT of formatting work I had done
previously when I thought I was only going to be able to keep with a
timestamp column type.
Could someone suggest a replacement query for the one above, where I would
not have to change my datetime column from timestamp to datetime?
Alternatively, could someone suggest a Java alternative to the following
that would allow me to get the HH:mm from a datetime column type?
SimpleDateFormat("HH:mm").format(rs.getTime("datetime_col"))
I tried playing around with rs.getDate to get HH:mm, but couldn't see the
light. Specifically, (rs.getDate("datetime_col").getTime()) did not work.
Anyone? It's 4:35 AM. I'm dying. Many Thanks.
---------------------------------------------------------------------
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