开发者

MySQL Date, Minutes Add to a value

开发者 https://www.devze.com 2023-01-05 05:27 出处:网络
I cant seem to get this to work, It returns Null SELECT sdt, timeFor, DATE_ADD(TIMESTAMP(sdt), INTERVAL timeFor MINUTE) FROM tbl_day

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

精彩评论

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