In MySQL,
SELECT WEEK('2019-01-07')
is showing week number 1.
But if I see, 2019 starts from Tuesday and current week for that date is week number 2.
How can I get the current week according to the year in this way?
In MySQL,
SELECT WEEK('2019-01-07')
is showing week number 1.
But if I see, 2019 starts from Tuesday and current week for that date is week number 2.
How can I get the current week according to the year in this way?
Maybe you need WEEKOFYEAR
function:
SELECT WEEKOFYEAR('2019-01-07'); # returns 2