USE test;
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (anydate DATE);
INSERT INTO foo VALUES (CURRENT_DATE), (CURRENT_DATE - INTERVAL 121 DAY);
SELECT
anydate,
anydate - INTERVAL (5 + DAYOFWEEK(anydate)) MOD 7 DAY AS Monday
FROM foo;
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --