sql - Firebird - select rows with date field having values within this week -
the title pretty explains it, trying select rows table date field has values within current week. want rows current week's monday until current day.
example:
id adate --------------- 1 11-11-2010 2 12-11-2010 3 13-11-2010 4 14-11-2010 5 15-11-2010
the rows want in case are:
id adate --------------- 4 14-11-2010 //this week's monday 5 15-11-2010 //till today
any please?
this work on week sunday saturday. shall adapt if want weeks monday sunday:
select * mytable adate between cast('now' date) - extract(weekday cast('now' date)) --prev sunday , cast('now' date) - extract(weekday cast('now' date)) + 6 --next saturday ;
Comments
Post a Comment