Posted by Felix Geerinckx on 09/14/05 10:54
On 14/09/2005, NC wrote:
> toedipper wrote:
>
> > Is there any way in Mysql to work out the start of the
> > current week?
>
> Not that I know of
If your week starts on Monday:
SELECT
CURRENT_DATE - INTERVAL (5 + DAYOFWEEK(CURRENT_DATE)) MOD 7 DAY;
If your week starts on Sunday:
SELECT
CURRENT_DATE + INTERVAL 1 DAY - INTERVAL DAYOFWEEK(CURRENT_DATE) DAY;
--
felix
Navigation:
[Reply to this message]
|