Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL: how to use DATE to select last two weeks when the year changes (2006/2007)

SQL: how to use DATE to select last two weeks when the year changes (2006/2007)

From: <joe1977_at_tlen.pl>
Date: 2 Jan 2007 11:34:01 -0800
Message-ID: <1167766441.170433.136500@s34g2000cwa.googlegroups.com>


how can one select or group records for last two weeks? I used to do it (just for one year):

TO_CHAR(CREATED, 'IW') >= (TO_CHAR(SYSDATE, 'IW')-2) but now I need to add a year to that query.

Basicaly, I need last 2 weeks of data, even though the year changed from 2006 to 2007.

ps. Happy New Year :) Received on Tue Jan 02 2007 - 13:34:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US