MySQL Date, Minutes Add to a value
I cant seem to get this to work, It returns Null
SELECT sdt, timeFor, DATE_ADD(TIMESTAMP(sdt), INTERVAL timeFor MINUTE) FROM tbl_day
The return keeps returning
sdt, timeFor, DATE_ADD(TIMESTAMP(sdt), INTERVAL timeFor MINUTE)
'0000-00-00 01:00:00', 15, ''
Columns Type
- sdt DATETIME
- timeFor BIGINT(开发者_StackOverflow中文版20)
Any ideas
MySQL usually returns NULL on date/time operations when column value is incomplete datetime. Something like 2010-00-05 11:22:33
, etc. Also using timestamp function on sdt
column might not be a good idea. I'd suggest providing normal datetime value.
精彩评论