This topic is locked
[SOLVED]

 week(date)

3/27/2018 11:21:59 AM
PHPRunner General questions
J
jackheitzer@gmail.com author

Hi all,
In a query I use



SELECT * week(date) AS week FROM mytable WHERE WEEK(date) = WEEK(CURDATE())


This works fine, it picks the week however it picks the week from Sunday. I would like the week to start on Monday. Is there a workaround?
Best regards,
Jack

Sergey Kornilov admin 3/27/2018

WEEK function has several modes and you can tell it to start a week on Monday:

https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_week

J
jackheitzer@gmail.com author 3/28/2018



WEEK function has several modes and you can tell it to start a week on Monday:

https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_week


Thank you Sergey, exactly what I needed...