Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL: how to use DATE to select last two weeks when the year changes (2006/2007)
Charles Hooper wrote:
> joe1977_at_tlen.pl wrote:
> > how can one select or group records for last two weeks?
> > I used to do it (just for one year):
> >
This seems to imply that:
> TO_CHAR(CREATED, 'IW') >= (TO_CHAR(SYSDATE, 'IW')-2)
>
> Becomes:
> CREATED >= (TRUNC(NEXT_DAY(SYSDATE,'MONDAY')-7)-13)
>
thank you very much, that makes sense to me (and Oracle :))) Received on Tue Jan 02 2007 - 21:29:57 CST
![]() |
![]() |