赞
踩
2014-03-21 16:36:54
0
I'm trying to insert a record to a table and I get the following error.
Mysql Error Code : 1292 Incorrect datetime value : ''
Mysql code snip-let is as follows
INSERT INTO tbl_dashboard (avg_response)
SELECT cast(ifnull(floor(avg(5 * (DATEDIFF(substring(im.inq_managerreply,-10), im.inq_managerdate) DIV 7)
+ MID('0123444401233334012222340111123400001234000123440',
7 * WEEKDAY(im.inq_managerdate) + WEEKDAY(substring(im.inq_managerreply,-10)) + 1, 1))),'not_applicable')AS CHAR(45)) 'average_response_time_in_working_days'
FROM inq_manager im
There are no errors in executing the select statement which gives the average response time excluding the weekends but when I try to insert the above to my table the error is given.
The data type of the tbl_dashboard is avg_response char(45)
How can I overcome this . Please help
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。