Hello friends, could you help me with the following:
I have a field with a timestamp format and I would like to know how to get the next Monday at midday to save it in date_end
.
journay date_start date_end
1 1515200400 1515369600
2 1515805200 1515974400
3 1516410000 1516579200
4 1517014800 1517184000
5 1517619600 1517788800
I have the following query in which if I get Monday but at 6pm and I would like it at noon, that is to say at 12:00 pm
select journay, DATE_ADD(FROM_UNIXTIME(max(date_game_large)), INTERVAL (9 - IF(DAYOFWEEK(FROM_UNIXTIME(max(date_game_large)))=1, 8, DAYOFWEEK(FROM_UNIXTIME(max(date_game_large))))) DAY) as NEXTMONDAY from tablaone GROUP by journay order by journay
id_competition journay . date_start date_end
385 1 1515200400 2018-01-08 18:00:00
385 2 1515805200 2018-01-15 18:00:00
385 3 1516410000 2018-01-22 18:00:00
385 4 1517014800 2018-01-29 18:00:00
385 5 1517619600 2018-02-05 18:00:00
Could you help me please