开发者

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

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜