$ ls | egrep staff-list-[0-9]{2}-[A-z]{3}-[0-9]{4}.csv
staff-list-22-aug-2011.csv
Monday, August 15, 2011
Wednesday, August 10, 2011
MySQL get Start(Sunday) and End(Saturday) of week for a given date
select subdate(date('2011-08-06'), INTERVAL dayofweek(date('2011-08-06')) DAY) as StartOfWeek, adddate(date('2011-08-06'), INTERVAL 7-dayofweek(date('2011-08-06')) DAY) as EndOfWeek;
select subdate(date('2011-08-07'), INTERVAL dayofweek(date('2011-08-07')) DAY) as StartOfWeek, adddate(date('2011-08-07'), INTERVAL 7-dayofweek(date('2011-08-07')) DAY) as EndOfWeek;
select subdate(date('2011-08-13'), INTERVAL dayofweek(date('2011-08-13')) DAY) as StartOfWeek, adddate(date('2011-08-13'), INTERVAL 7-dayofweek(date('2011-08-13')) DAY) as EndOfWeek;
select subdate(date('2011-08-07'), INTERVAL dayofweek(date('2011-08-07')) DAY) as StartOfWeek, adddate(date('2011-08-07'), INTERVAL 7-dayofweek(date('2011-08-07')) DAY) as EndOfWeek;
select subdate(date('2011-08-13'), INTERVAL dayofweek(date('2011-08-13')) DAY) as StartOfWeek, adddate(date('2011-08-13'), INTERVAL 7-dayofweek(date('2011-08-13')) DAY) as EndOfWeek;
Subscribe to:
Posts (Atom)