我正在尝试计算自给定日期以来已经过了多少个工作日
CREATE TABLE `TestTable` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user` varchar(255) DEFAULT NULL,
`date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
这是我的查询,但是我被卡住了
SELECT
SUM(5 * (DATEDIFF(NOW(), date) DIV 7) + MID('0123444401233334012222340111123400001234000123440',
7 * WEEKDAY(date) + WEEKDAY(date) + 1,
1) + ((TIMESTAMPDIFF(SECOND,
NOW(),
date) / 86400) - (DATEDIFF(NOW(), date)))) AS Business_Days, user, date
FROM
MyDB.TestTable
如果有人可以帮助我告诉我我做错了。