If the week starts on Sunday do this:
DATE_ADD(mydate, INTERVAL(1-DAYOFWEEK(mydate)) DAY)
If the week starts on Monday do this:
DATE_ADD(mydate, INTERVAL(-WEEKDAY(mydate)) DAY);
More Related Contents:
- MySQL SELECT WHERE datetime matches day (and not necessarily time)
- MySQL Query – Records between Today and Last 30 Days
- Select mysql query between date?
- How to get an age from a D.O.B field in MySQL?
- Compare only day and month with date field in mysql
- Recreating a query using INNER JOIN? [duplicate]
- How to convert a string to date in MySQL?
- Create a temporary table in a SELECT statement without a separate CREATE TABLE
- Converting a date in MySQL from string field
- MySQL: Select All Dates In a Range Even If No Records Present
- Ordering by specific field value first
- SELECT / GROUP BY – segments of time (10 seconds, 30 seconds, etc)
- CURRENT_DATE/CURDATE() not working as default DATE value
- INSERT INTO…SELECT for all MySQL columns
- How to select date from datetime column?
- #1139 – Got error ‘repetition-operator operand invalid’ from regexp
- Checking multiple columns for one value
- MySQL difference between two rows of a SELECT Statement
- MySQL – How to select data by string length
- How to select the most recent set of dated records from a mysql table
- MySQL date format
- Difference in minutes from two time fields in MySQL
- quick selection of a random row from a large table in mysql
- SELECT query return 1 row from each group
- Comma separated string of selected values in MySQL
- SELECT INTO Variable in MySQL DECLARE causes syntax error?
- MySQL Error: #1142 – SELECT command denied to user
- #1292 – Incorrect date value: ‘0000-00-00’ [duplicate]
- MySQL cumulative sum grouped by date
- Working with INTERVAL and CURDATE in MySQL