周二添加金额为星期二+星期一

时间:2017-09-13 16:30:02

标签: mysql sql date reportbuilder

日期 - 金额 - 日期名称

2017-09-05 364100.00星期二 2017-09-11 189700.00星期一

周二的价值应为364100 + 189700

1 个答案:

答案 0 :(得分:1)

SELECT * 
FROM origination_table
WHERE  WEEKDAY(origination_date) <= WEEKDAY(NOW())
   AND WEEKDAY(origination_date) > WEEKDAY(NOW())-2
   AND .... others like origination_date>=DATE_SUB(NOW(),INTERVAL 7 day)