Search code examples
mysqlsqldatereportbuilder

add amount on tuesday as tuesday +monday


Date - amount- name of date

2017-09-05 364100.00 Tuesday 2017-09-11 189700.00 Monday

Tuesday should have value as 364100+189700


Solution

  • 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)