Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> date arithmetic in oracle?
I want to select on the basis of date arithmetic.. ie
create table TABLEX (A varchar(10), B date);
insert into tablex values ('number1', ( to_date ( '10-Jan-2000',
'dd-Mon-yyyy','NLS_DATE_LANGUAGE = American') ));
insert into tablex values ('number2', ( to_date ( '20-Jan-2000',
'dd-Mon-yyyy','NLS_DATE_LANGUAGE = American') ));
and I want to select * from TABLEX where date < (sysdate-7days) any ideas??
I know I can do
select * from tablex where b < (select sysdate from dual); to get where
date < sysdate.
and can do
select * from tablex where b < (SELECT ADD_MONTHS(SYSDATE, -1) FROM
DUAL);
to get where date < sysdate - 1 month.
As far as I can tell there is no add_days or add_weeks function. Any ideas??
M
![]() |
![]() |